Fix writer2latex quote handling (bug #8903)

writer2latex surrounds quotes by braces which we skip to avoid useless ERT.
I broke this in 25fe87e5 which made Parser::next_next_token() not recognize
that it needed to parse one more token. If we had a unit test for the Parser
class it would probably have detected that. Now we have at least a test for
the special quote.
This commit is contained in:
Georg Baum 2013-12-11 21:54:26 +01:00
parent bbdff9996f
commit 99cdabd206
3 changed files with 14 additions and 4 deletions

View File

@ -319,11 +319,10 @@ Token const Parser::next_next_token()
return dummy;
// If tokenize_one() has not been called after the last get_token() we
// need to tokenize two more tokens.
if (pos_ >= tokens_.size()) {
if (pos_ >= tokens_.size())
tokenize_one();
if (pos_ + 1 >= tokens_.size())
tokenize_one();
if (pos_ + 1 >= tokens_.size())
tokenize_one();
}
return pos_ + 1 < tokens_.size() ? tokens_[pos_ + 1] : dummy;
}

View File

@ -6635,6 +6635,14 @@ script with
.
\end_layout
\begin_layout Standard
latex2writer outputs quotes in braces like
\begin_inset Quotes ers
\end_inset
. We swallow the, but this was one broken (bug 8903).
\end_layout
\begin_layout Section
Mathematics
\begin_inset Index idx

View File

@ -654,6 +654,9 @@ builtin \textasciicircum % with a comment
A sub\textsubscript{sc\emph{ript}} and super\textsuperscript{script
with $a^2+b^2=c^2$ math}.
latex2writer outputs quotes in braces like {\textquoteright}. We swallow the,
but this was one broken (bug 8903).
\section{Mathematics\index{Mathematics}}