From: Jürgen Spitzmüller Date: Sat, 10 May 2008 17:19:26 +0000 (+0000) Subject: * lib/lyx2lyx/lyx_1_6.py: X-Git-Tag: 1.6.10~4827 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=27ac72bfa9f6a660e892057ce746afa103f8e796;p=lyx.git * lib/lyx2lyx/lyx_1_6.py: - more work on InsetIndex reversion. Still lots left to do. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24711 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/lyx2lyx/lyx_1_6.py b/lib/lyx2lyx/lyx_1_6.py index 3506a2ea9c..e0e33ea868 100644 --- a/lib/lyx2lyx/lyx_1_6.py +++ b/lib/lyx2lyx/lyx_1_6.py @@ -812,10 +812,12 @@ def revert_latexcommand_index(document): document.body[i + 1] = "LatexCommand index" # clean up multiline stuff content = "" + ert_end = 0 for k in range(i + 3, j - 2): line = document.body[k] if line.startswith("\\begin_inset ERT"): - line = line[16:] + ert_end = find_end_of_inset(document.body, k + 1) + line = line[16:] if line.startswith("\\begin_inset Formula"): line = line[20:] if line.startswith("\\begin_layout Standard"): @@ -828,8 +830,15 @@ def revert_latexcommand_index(document): line = line[10:] if line.startswith("status collapsed"): line = line[16:] - line = line.replace(u'ä', r'\\\"a').replace(u'ö', r'\\\"o').replace(u'ü', r'\\\"u') - line = line.replace(r'\backslash', r'\textbackslash{}') + if line.startswith("status open"): + line = line[11:] + # do not replace inside ERTs + if ert_end < k: + line = line.replace(u'ä', r'\\\"a').replace(u'ö', r'\\\"o').replace(u'ü', r'\\\"u') + line = line.replace(r'\backslash', r'\textbackslash{}') + line = line.replace(r'\InsetSpace ', r'') + else: + line = line.replace(r'\backslash', r'\\') content = content + line; document.body[i + 3] = "name " + '"' + content + '"' for k in range(i + 4, j - 2):