mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-20 06:49:56 +00:00
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
This commit is contained in:
parent
76c3d964df
commit
60dc3fea2f
@ -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]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user