]> git.lyx.org Git - lyx.git/commitdiff
Small improvement to 2ac48f2c.
authorKornel Benko <kornel@lyx.org>
Tue, 15 Dec 2020 11:54:04 +0000 (12:54 +0100)
committerKornel Benko <kornel@lyx.org>
Tue, 15 Dec 2020 11:55:50 +0000 (12:55 +0100)
Making the regex little more robust.

lib/scripts/prefs2prefs_prefs.py

index 61c93d05befe743336123b41be6550a15cd37ddf..d3a70d26574eb9d550530f533c92c63824ee9e64 100644 (file)
@@ -458,11 +458,11 @@ def rename_cyrillic_kmap_files(line):
 def add_dark_color(line):
        if not line.lower().startswith("\\set_color "):
                return no_match
-       colre = re.compile(r'^\\set_color\s+(.*)\s+(.*)"', re.IGNORECASE)
+       colre = re.compile(r'^\\set_color\s+("[^"]+")\s+("[^"]+")\s*$', re.IGNORECASE)
        m = colre.match(line)
        if not m:
                return no_match
-       line += " " + m.group(2) + '"'
+       line += " " + m.group(2)
        return (True, line)
 
 # End conversions for LyX 2.3 to 2.4