From 5a78a112b6ac14a9cdb0fd5dc0c06aa89578eff5 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Mon, 9 Feb 2015 17:24:13 -0500 Subject: [PATCH] Fix bug #9383. Writing directly to the output stream bypassed the machinery that clears the tag stack. --- src/insets/InsetQuotes.cpp | 24 ++++++++++++++---------- src/insets/InsetQuotes.h | 2 ++ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/insets/InsetQuotes.cpp b/src/insets/InsetQuotes.cpp index 8a183fa0fa..9cb4786bda 100644 --- a/src/insets/InsetQuotes.cpp +++ b/src/insets/InsetQuotes.cpp @@ -307,26 +307,30 @@ int InsetQuotes::plaintext(odocstringstream & os, } -int InsetQuotes::docbook(odocstream & os, OutputParams const &) const -{ +docstring InsetQuotes::getQuoteEntity() const { if (times_ == DoubleQuotes) { if (side_ == LeftQuote) - os << "“"; - else - os << "”"; - } else { - if (side_ == LeftQuote) - os << "‘"; + return from_ascii("“"); else - os << "’"; + return from_ascii("”"); } + if (side_ == LeftQuote) + return from_ascii("‘"); + else + return from_ascii("’"); +} + + +int InsetQuotes::docbook(odocstream & os, OutputParams const &) const +{ + os << getQuoteEntity(); return 0; } docstring InsetQuotes::xhtml(XHTMLStream & xs, OutputParams const & op) const { - docbook(xs.os(), op); + xs << XHTMLStream::ESCAPE_NONE << getQuoteEntity(); return docstring(); } diff --git a/src/insets/InsetQuotes.h b/src/insets/InsetQuotes.h index 932cd9168d..98a0cbbcf8 100644 --- a/src/insets/InsetQuotes.h +++ b/src/insets/InsetQuotes.h @@ -109,6 +109,8 @@ private: void parseString(std::string const &); /// docstring displayString() const; + /// + docstring getQuoteEntity() const; /// QuoteLanguage language_; -- 2.39.2