commit cd4a4da603e69a88c7eec17fb9473171bf2ec42c
Author: Juergen Spitzmueller <[email protected]>
Date: Wed Oct 29 13:14:38 2025 +0100
amend e837fe8a4f56
correctly handle \protect'ed special chars
---
src/tex2lyx/text.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp
index 8016c3cb2e..dabde37f60 100644
--- a/src/tex2lyx/text.cpp
+++ b/src/tex2lyx/text.cpp
@@ -5478,8 +5478,10 @@ void parse_text(Parser & p, ostream & os, unsigned
flags, bool outer,
if (isKnownSpecialChar(t.cs(), lyxname)
|| (t.cs() == "protect"
&& p.next_token().cat() == catEscape
- && isKnownSpecialChar(t.cs(), lyxname, true))) {
+ && isKnownSpecialChar(p.next_token().cs(), lyxname,
true))) {
// LyX sometimes puts a \protect in front, so we have
to ignore it
+ if (t.cs() == "protect")
+ p.get_token();
context.check_layout(os);
os << "\\SpecialChar " << lyxname << '\n';
skip_spaces_braces(p);
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs