commit 37721f34af26527d584c302d0cc915cbe2e50a8b
Author: Juergen Spitzmueller <[email protected]>
Date: Sun Aug 30 15:51:29 2026 +0200
lyx2lyx: consider deeper nested includes in has_token
---
lib/lyx2lyx/parser_tools.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/lyx2lyx/parser_tools.py b/lib/lyx2lyx/parser_tools.py
index 147df63426..39afc5f01a 100644
--- a/lib/lyx2lyx/parser_tools.py
+++ b/lib/lyx2lyx/parser_tools.py
@@ -291,9 +291,10 @@ def has_token(lines, token, directory=""):
fn = os.path.join(directory, fn)
if fn.endswith(".lyx") and os.path.isfile(fn):
with open(fn) as f:
- for line in f:
- if line.startswith(token):
- return True
+ clines = [line.rstrip() for line in f]
+ cdir = os.path.dirname(fn)
+ if has_token(clines, token, cdir):
+ return True
i += 1
return False
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs