X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetCitation.cpp;h=8f697993b143c94d43d011c2a6fbd50bdf5bfa80;hb=9c55af4a223ce4db29d643251109e245665344bd;hp=b21ae6ae39c9855b14d5da76015d4a804e9f5f56;hpb=86994bf75320524ec656fd70950633c83d445a6c;p=lyx.git diff --git a/src/insets/InsetCitation.cpp b/src/insets/InsetCitation.cpp index b21ae6ae39..8f697993b1 100644 --- a/src/insets/InsetCitation.cpp +++ b/src/insets/InsetCitation.cpp @@ -33,6 +33,7 @@ #include "support/lstrings.h" #include +#include using namespace std; using namespace lyx::support; @@ -221,7 +222,7 @@ inline docstring wrapCitation(docstring const & key, return content; // we have to do the escaping here, because we will ultimately // write this as a raw string, so as not to escape the tags. - return "" + + return "" + html::htmlize(content, XHTMLStream::ESCAPE_ALL) + ""; } @@ -273,8 +274,8 @@ docstring InsetCitation::complexLabel(bool for_xhtml) const buffer().params().documentClass().addCiteMacro("!textafter", to_utf8(after)); */ docstring label; - vector const keys = getVectorFromString(key); - label = biblist.getLabel(keys, buffer(), cite_type, for_xhtml, before, after); + vector keys = getVectorFromString(key); + label = biblist.getLabel(keys, buffer(), cite_type, for_xhtml, UINT_MAX, before, after); return label; } @@ -333,9 +334,10 @@ void InsetCitation::updateBuffer(ParIterator const &, UpdateType) void InsetCitation::addToToc(DocIterator const & cpit, bool output_active) const { // NOTE - // XHTML output uses the TOC to collect the citations - // from the document. So if this gets changed, then we - // will need to change how the citations are collected. + // BiblioInfo::collectCitedEntries() uses the TOC to collect the citations + // from the document. It is used indirectly, via BiblioInfo::makeCitationLables, + // by both XHTML and plaintext output. So, if we change what goes into the TOC, + // then we will also need to change that routine. docstring const tocitem = getParam("key"); Toc & toc = buffer().tocBackend().toc("citation"); toc.push_back(TocItem(cpit, 0, tocitem, output_active)); @@ -403,7 +405,7 @@ void InsetCitation::toString(odocstream & os) const } -void InsetCitation::forToc(docstring & os, size_t) const +void InsetCitation::forOutliner(docstring & os, size_t) const { os += screenLabel(); } @@ -422,7 +424,7 @@ void InsetCitation::latex(otexstream & os, OutputParams const & runparams) const // FIXME UNICODE docstring const cite_str = from_utf8(citationStyleToString(cs)); - if (runparams.inulemcmd) + if (runparams.inulemcmd > 0) os << "\\mbox{"; os << "\\" << cite_str;