#include "support/lstrings.h"
#include <algorithm>
+#include <climits>
using namespace std;
using namespace lyx::support;
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 "<a href='#LyXCite-" + key + "'>" +
+ return "<a href='#LyXCite-" + html::cleanAttr(key) + "'>" +
html::htmlize(content, XHTMLStream::ESCAPE_ALL) + "</a>";
}
buffer().params().documentClass().addCiteMacro("!textafter", to_utf8(after));
*/
docstring label;
- vector<docstring> const keys = getVectorFromString(key);
- label = biblist.getLabel(keys, buffer(), cite_type, for_xhtml, before, after);
+ vector<docstring> keys = getVectorFromString(key);
+ label = biblist.getLabel(keys, buffer(), cite_type, for_xhtml, UINT_MAX, before, after);
return label;
}
}
-void InsetCitation::addToToc(DocIterator const & cpit) const
+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));
+ toc.push_back(TocItem(cpit, 0, tocitem, output_active));
}
-int InsetCitation::plaintext(odocstream & os, OutputParams const &) const
+int InsetCitation::plaintext(odocstringstream & os,
+ OutputParams const &, size_t) const
{
string const & cmd = getCmdName();
if (cmd == "nocite")
void InsetCitation::toString(odocstream & os) const
{
- plaintext(os, OutputParams(0));
+ odocstringstream ods;
+ plaintext(ods, OutputParams(0));
+ os << ods.str();
}
-void InsetCitation::forToc(docstring & os, size_t) const
+void InsetCitation::forOutliner(docstring & os, size_t) const
{
os += screenLabel();
}
// FIXME UNICODE
docstring const cite_str = from_utf8(citationStyleToString(cs));
- if (runparams.inulemcmd)
+ if (runparams.inulemcmd > 0)
os << "\\mbox{";
os << "\\" << cite_str;