From: Georg Baum Date: Sat, 3 Jan 2015 19:45:06 +0000 (+0100) Subject: Fix parsing of verbatim options (bug #9113) X-Git-Tag: 2.2.0alpha1~1391 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=3f72a026cc26e8e8dfdd306a62fd174b51dd59c4;p=features.git Fix parsing of verbatim options (bug #9113) Parser::verbatimOption() did swallow backslashes previously. The similar code in Parser::verbatim_item() was already correct. --- diff --git a/src/tex2lyx/Parser.cpp b/src/tex2lyx/Parser.cpp index 7a9fff1372..69e3460f45 100644 --- a/src/tex2lyx/Parser.cpp +++ b/src/tex2lyx/Parser.cpp @@ -704,7 +704,7 @@ string Parser::verbatimOption() putback(); res += '{' + verbatim_item() + '}'; } else - res += t.cs(); + res += t.asInput(); } } return res; diff --git a/src/tex2lyx/test/test-insets.lyx.lyx b/src/tex2lyx/test/test-insets.lyx.lyx index d0622bdffa..39798fb6e5 100644 --- a/src/tex2lyx/test/test-insets.lyx.lyx +++ b/src/tex2lyx/test/test-insets.lyx.lyx @@ -707,6 +707,28 @@ key "gur+04" \begin_layout Bibliography +\begin_inset CommandInset bibitem +LatexCommand bibitem +label "Möstl et~al.(2010)" +key "Mostl2010" + +\end_inset + + Gürkan, M. +\begin_inset space ~ + +\end_inset + +A., Freitag, M., & Rasio, F. +\begin_inset space ~ + +\end_inset + +A. 2004, ApJ, 604, 632 +\end_layout + +\begin_layout Bibliography + \begin_inset CommandInset bibitem LatexCommand bibitem label "{{Gürkan et~al.}(2004)}" diff --git a/src/tex2lyx/test/test-insets.tex b/src/tex2lyx/test/test-insets.tex index e6249fc665..162ebd843a 100644 --- a/src/tex2lyx/test/test-insets.tex +++ b/src/tex2lyx/test/test-insets.tex @@ -141,6 +141,8 @@ From bug 7306: \citet{gur+04} have demonstrated that authors should not have umlauts in their names. It's OK to use them in the man\"{u}script, though. \begin{thebibliography}{References} +\bibitem[M\"{o}stl et~al.(2010)]{Mostl2010} Gürkan, M.~A., Freitag, +M., \& Rasio, F.~A. 2004, ApJ, 604, 632 \bibitem[{{G\"{u}rkan et~al.}(2004)}]{gur+04} Gürkan, M.~A., Freitag, M., \& Rasio, F.~A. 2004, ApJ, 604, 632\end{thebibliography}