[LyX/master] Fix lyx2lyx issue reported on ML
Scott Kostyshak
skostysh at lyx.org
Wed Sep 6 15:51:03 UTC 2023
commit 77fc67d3f01576070bb51cedc4d578c0457f5bce
Author: Scott Kostyshak <skostysh at lyx.org>
Date: Wed Sep 6 13:05:07 2023 -0400
Fix lyx2lyx issue reported on ML
The issue was reported on lyx-users by Chris Menzel [1].
Patch is from José Matos [2].
[1] https://www.mail-archive.com/search?l=mid&q=BD744D7E-54B4-4E95-A4E3-6B28F4987DE1%40gmail.com
[2] https://www.mail-archive.com/search?l=mid&q=c2ac54c2322d24051f171558ad8487ea4f7078ed.camel%40gmail.com
---
lib/lyx2lyx/parser_tools.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/lib/lyx2lyx/parser_tools.py b/lib/lyx2lyx/parser_tools.py
index cc22236..96abb1c 100644
--- a/lib/lyx2lyx/parser_tools.py
+++ b/lib/lyx2lyx/parser_tools.py
@@ -689,7 +689,8 @@ def count_pars_in_inset(lines, i):
pars = 0
for j in range(ins[1], ins[2]):
m = re.match(r'\\begin_layout (.*)', lines[j])
- if m and get_containing_inset(lines, j)[1] == ins[1]:
+ found_inset = get_containing_inset(lines, j)
+ if m and found_inset and found_inset[1] == ins[1]:
pars += 1
return pars
More information about the lyx-cvs
mailing list