summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9a6c402)
We assume chunks come at us in a certain form. If not, then
we cannot handle the conversion. In that case, we just leave
the chunks as they were and they will appear as unknown layouts.
document.warning("Malformed LyX documents. Can't find end of Chunk layout!")
break
thischunk = "".join(document.body[i + 1:j])
document.warning("Malformed LyX documents. Can't find end of Chunk layout!")
break
thischunk = "".join(document.body[i + 1:j])
- contents.append(thischunk)
+ contents.append(document.body[i + 1:j])
if thischunk == "@":
break
if thischunk == "@":
break
layout = get_value(document.body, "\\begin_layout", i)
#sys.stderr.write(layout+ '\n')
if layout != "Chunk":
layout = get_value(document.body, "\\begin_layout", i)
#sys.stderr.write(layout+ '\n')
if layout != "Chunk":
-
- sys.stderr.write('\n'.join(contents) + '\n\n')
-
# the last chunk should simply have an "@" in it
# the last chunk should simply have an "@" in it
+
+ if ''.join(contents[-1]) != "@":
+ document.warning("Unexpected chunk contents.")
+ continue
+
contents.pop()
# the first item should look like: <<FROGS>>=
# we want the inside
contents.pop()
# the first item should look like: <<FROGS>>=
# we want the inside
+ optarg = ' '.join(contents[0])
optarg.strip()
match = first_re.search(optarg)
if match:
optarg.strip()
match = first_re.search(optarg)
if match:
newstuff.extend(['', '\\begin_layout Plain Layout', ''])
else:
didone = True
newstuff.extend(['', '\\begin_layout Plain Layout', ''])
else:
didone = True
- newstuff.extend([c, '\\end_layout'])
+ newstuff.extend(c)
+ newstuff.append('\\end_layout')
newstuff.extend(['', '\\end_inset', '', '\\end_layout', ''])
newstuff.extend(['', '\\end_inset', '', '\\end_layout', ''])