From: Georg Baum Date: Thu, 21 Oct 2004 14:04:59 +0000 (+0000) Subject: fix bug 1620 in tex2lyx X-Git-Tag: 1.6.10~14932 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=83eced7fdc393d2b7a4c78316d4b23a2050cf012;p=features.git fix bug 1620 in tex2lyx git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9098 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/tex2lyx/ChangeLog b/src/tex2lyx/ChangeLog index a788fdcad8..93dc72013d 100644 --- a/src/tex2lyx/ChangeLog +++ b/src/tex2lyx/ChangeLog @@ -1,3 +1,8 @@ +2004-10-20 Georg Baum + + * text.C (parse_text): replace newlines with spaces in arguments to + known latex commands, fixes bug 1620 + 2004-10-12 Georg Baum * preamble.C (end_preamble): change file format from 236 to 237 diff --git a/src/tex2lyx/text.C b/src/tex2lyx/text.C index d5cced42c0..6a6bf7d7f7 100644 --- a/src/tex2lyx/text.C +++ b/src/tex2lyx/text.C @@ -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); }