From 60dc3fea2f3279e1dc11a9f54e1d8927cd2f0d83 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Matox?= Date: Mon, 12 Feb 2007 00:15:20 +0000 Subject: [PATCH] Color has a different reset (adjusting for it). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17145 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/lyx2lyx/lyx_1_5.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/lyx2lyx/lyx_1_5.py b/lib/lyx2lyx/lyx_1_5.py index 1da4327719..b559850430 100644 --- a/lib/lyx2lyx/lyx_1_5.py +++ b/lib/lyx2lyx/lyx_1_5.py @@ -1096,13 +1096,18 @@ def normalize_font_whitespace(document): lines = document.body - char_properties = ("\\series", "\\emph", "\\color", "\\shape", "\\family") + char_properties = {"\\series": "default", + "\\emph": "default", + "\\color": "none", + "\\shape": "default", + "\\family": "default"} for i in range(len(lines)): words = lines[i].split() - if len(words) > 1 and words[0] in char_properties \ - and words[1] == "default" and lines[i-1][-1] == " ": + if len(words) > 1 and words[0] in char_properties.keys() \ + and words[1] == char_properties[words[0]] \ + and lines[i-1][-1] == " ": lines[i-1] = lines[i-1][:-1] lines[i+1] = " " + lines[i+1] -- 2.39.2