]> git.lyx.org Git - lyx.git/commitdiff
Don't allow raw newlines in options
authorEnrico Forestieri <forenr@lyx.org>
Sat, 17 Jun 2017 17:05:02 +0000 (19:05 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Sat, 17 Jun 2017 17:05:02 +0000 (19:05 +0200)
This happens if the options are split over multiple lines in the
latex source. A newline here confuses the lexer when reading the
converted LyX file.

src/tex2lyx/text.cpp

index ab000939b811bd4b5199eed56e04e6ee3e9ac016..e5180cffe690f8920bc82ec0f346acb18b0573a6 100644 (file)
@@ -1326,7 +1326,7 @@ void parse_listings(Parser & p, ostream & os, Context & parent_context,
 {
        parent_context.check_layout(os);
        begin_inset(os, "listings\n");
-       string arg = p.hasOpt() ? p.verbatimOption() : string();
+       string arg = p.hasOpt() ? subst(p.verbatimOption(), "\n", "") : string();
        if (use_minted) {
                string const language = p.getArg('{', '}');
                p.skip_spaces(true);