diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 50eee93a3d..c28e4366e6 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -3573,7 +3573,8 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, context.font.language, lang); } - else if (is_known(t.cs().substr(4, string::npos), polyglossia_languages)) { + else if (prefixIs(t.cs(), "text") + && is_known(t.cs().substr(4), polyglossia_languages)) { // scheme is \textLANGUAGE{text} where LANGUAGE is in polyglossia_languages[] string lang; // We have to output the whole command if it has an option