commit 15d3b7bae20c819af0d3654ae09ca139048e8904
Author: Juergen Spitzmueller <[email protected]>
Date: Wed Oct 15 14:07:14 2014 +0200
lyx2lyx: fix convert_chunks for empty chunk layouts
Fixes: #9298
diff --git a/lib/lyx2lyx/lyx_2_1.py b/lib/lyx2lyx/lyx_2_1.py
index 289a4d4..6b2a75f 100644
--- a/lib/lyx2lyx/lyx_2_1.py
+++ b/lib/lyx2lyx/lyx_2_1.py
@@ -4577,9 +4577,14 @@ def convert_chunks(document):
# The last chunk should simply have an "@" in it
# or at least end with "@" (can happen if @ is
# preceded by a newline)
- lastpar = ''.join(contents[-1])
+ lastpar = ''
+ if len(contents) > 0:
+ lastpar = ''.join(contents[-1])
if not lastpar.endswith("@"):
document.warning("Unexpected chunk content: chunk not terminated
by '@'!")
+ if len(contents) == 0:
+ # convert empty chunk layouts to Standard
+ document.body[start] = "\\begin_layout Standard"
continue
if lastpar == "@":