commit 644ae738c84805fececf71dbf71d177e3ed4daed
Author: Juergen Spitzmueller <[email protected]>
Date: Wed Apr 16 07:57:05 2025 +0200
Fix endless recursion and string detection mismatch in lyx2lyx (#13168)
---
lib/lyx2lyx/lyx2lyx_tools.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/lyx2lyx/lyx2lyx_tools.py b/lib/lyx2lyx/lyx2lyx_tools.py
index 561ee012f7..04c8e92e86 100644
--- a/lib/lyx2lyx/lyx2lyx_tools.py
+++ b/lib/lyx2lyx/lyx2lyx_tools.py
@@ -123,12 +123,14 @@ def add_to_preamble(document, text):
# we need a perfect match
matched = True
for line in text:
- if i >= prelen or line != document.preamble[i]:
+ if i >= prelen or line != document.preamble[i].strip():
matched = False
break
i += 1
if matched:
return
+ else:
+ i += 1
document.preamble.extend(["% Added by lyx2lyx"])
document.preamble.extend(text)
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs