Ignore \protect if it is directly in front of \LyX{} (otherwise it would

accumulate for each round trip, since LyX  writes \protect if needed)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37214 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2011-01-14 20:06:15 +00:00
parent cfd6767ec1
commit 7a74bbf06b

View File

@ -2134,9 +2134,15 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
os << "\\lyxline";
}
else if (is_known(t.cs(), known_phrases)) {
else if (is_known(t.cs(), known_phrases) ||
(t.cs() == "protect" &&
p.next_token().cat() == catEscape &&
is_known(p.next_token().cs(), known_phrases))) {
// LyX sometimes puts a \protect in front, so we have to ignore it
// FIXME: This needs to be changed when bug 4752 is fixed.
char const * const * where = is_known(t.cs(), known_phrases);
char const * const * where = is_known(
t.cs() == "protect" ? p.get_token().cs() : t.cs(),
known_phrases);
context.check_layout(os);
os << known_coded_phrases[where - known_phrases];
skip_spaces_braces(p);