[LyX/master] fix get_quoted_value
Juergen Spitzmueller
spitz at lyx.org
Thu Aug 15 06:06:07 UTC 2024
commit eb16ecf8b616e1c1a1eccc1fab7f252906ff7c23
Author: Juergen Spitzmueller <spitz at lyx.org>
Date: Thu Aug 15 08:04:48 2024 +0200
fix get_quoted_value
The previous version also stripped quotes that are part of the string
---
lib/lyx2lyx/parser_tools.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/lib/lyx2lyx/parser_tools.py b/lib/lyx2lyx/parser_tools.py
index 20e60b3a6a..148938cdb3 100644
--- a/lib/lyx2lyx/parser_tools.py
+++ b/lib/lyx2lyx/parser_tools.py
@@ -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}
More information about the lyx-cvs
mailing list