]> git.lyx.org Git - lyx.git/commitdiff
fix bug 1620 in tex2lyx
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Thu, 21 Oct 2004 14:04:59 +0000 (14:04 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Thu, 21 Oct 2004 14:04:59 +0000 (14:04 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9098 a592a061-630c-0410-9148-cb99ea01b6c8

src/tex2lyx/ChangeLog
src/tex2lyx/text.C

index a788fdcad88219f2ae2344730c511238a6c5d13f..93dc72013d8d17b31977e24058409339dd4b3b46 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-20  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
+
+       * text.C (parse_text): replace newlines with spaces in arguments to
+       known latex commands, fixes bug 1620
+
 2004-10-12  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
 
        * preamble.C (end_preamble): change file format from 236 to 237
index d5cced42c03c42ac7a91b84e3bfd4d868b426a79..6a6bf7d7f79aa3f8196d098db3f9bb2117babc9e 100644 (file)
@@ -1553,9 +1553,11 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                        context.check_layout(os);
                        begin_inset(os, "LatexCommand ");
                        os << '\\' << t.cs();
-                       os << p.getOpt();
-                       os << p.getOpt();
-                       os << '{' << p.verbatim_item() << "}\n";
+                       // lyx cannot handle newlines in a latex command
+                       // FIXME: Move the substitution into parser::getOpt()?
+                       os << subst(p.getOpt(), "\n", " ");
+                       os << subst(p.getOpt(), "\n", " ");
+                       os << '{' << subst(p.verbatim_item(), "\n", " ") << "}\n";
                        end_inset(os);
                }