]> git.lyx.org Git - lyx.git/commitdiff
fix get_quoted_value
authorJuergen Spitzmueller <spitz@lyx.org>
Thu, 15 Aug 2024 06:04:48 +0000 (08:04 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Thu, 15 Aug 2024 06:04:48 +0000 (08:04 +0200)
The previous version also stripped quotes that are part of the string

lib/lyx2lyx/parser_tools.py

index 20e60b3a6a5ca8cf2eda09141b580d808201e14e..148938cdb35335e1b78d9530b4478f87f7bfbcab 100644 (file)
@@ -430,7 +430,14 @@ def get_quoted_value(lines, token, start=0, end=0, default="", delete=False):
     val = get_value(lines, token, start, end, "", delete)
     if not val:
         return default
-    return val.strip('"')
+    # remove only outer pair of quotes,
+    # hence do not use strip('"')
+    if val[:1] == '"':
+        val = val[1:]
+    if val[-1:] == '"':
+        val = val[:-1]
+    
+    return val
 
 
 bool_values = {"true": True, "1": True, "false": False, "0": False}