]> git.lyx.org Git - features.git/commitdiff
Fix \nobreakdash- roundtrip in moving args
authorGeorg Baum <baum@lyx.org>
Fri, 27 Feb 2015 21:06:11 +0000 (22:06 +0100)
committerGeorg Baum <baum@lyx.org>
Fri, 27 Feb 2015 21:06:11 +0000 (22:06 +0100)
Previously, tex2lyx did not remove the \protect which is output by LyX in
front of \nobreakdash- if needed. Now tex2lyx removes it unconditionally (like
it does elsewhere), because LyX will add it if needed.

src/tex2lyx/text.cpp

index ce0443b7aa3c218003f8b0c2b9d10c0b9b4044bf..869fac9d8282a76ed1a2afdc85ef81e6839701cc 100644 (file)
@@ -3818,7 +3818,12 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                }
 
                else if ((t.cs() == "nobreakdash" && p.next_token().asInput() == "-") ||
+                        (t.cs() == "protect" && p.next_token().asInput() == "\\nobreakdash" &&
+                         p.next_next_token().asInput() == "-") ||
                         (t.cs() == "@" && p.next_token().asInput() == ".")) {
+                       // 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 \\" << t.cs()
                           << p.get_token().asInput() << '\n';