#include "InsetCitation.h"
+#include "BiblioInfo.h"
#include "Buffer.h"
#include "buffer_funcs.h"
#include "BufferParams.h"
#include "BufferView.h"
#include "DispatchResult.h"
-#include "FuncRequest.h"
#include "LaTeXFeatures.h"
#include "output_xhtml.h"
#include "ParIterator.h"
InsetCitation::InsetCitation(Buffer * buf, InsetCommandParams const & p)
- : InsetCommand(buf, p, "citation")
+ : InsetCommand(buf, p)
{}
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='#" + key + "'>" + html::htmlize(content) + "</a>";
+ return "<a href='#" + key + "'>" +
+ html::htmlize(content, XHTMLStream::ESCAPE_ALL) + "</a>";
}
} // anonymous namespace
}
-void InsetCitation::addToToc(DocIterator const & cpit)
+void InsetCitation::addToToc(DocIterator const & cpit) const
{
// NOTE
// XHTML output uses the TOC to collect the citations
return docstring();
// have to output this raw, because generateLabel() will include tags
- xs << XHTMLStream::NextRaw() << generateLabel(true);
+ xs << XHTMLStream::ESCAPE_NONE << generateLabel(true);
return docstring();
}
-void InsetCitation::tocString(odocstream & os) const
+void InsetCitation::toString(odocstream & os) const
{
plaintext(os, OutputParams(0));
}
+void InsetCitation::forToc(docstring & os, size_t) const
+{
+ os += screenLabel();
+}
+
+
// Have to overwrite the default InsetCommand method in order to check that
// the \cite command is valid. Eg, the user has natbib enabled, inputs some
// citations and then changes his mind, turning natbib support off. The output
// should revert to \cite[]{}
-int InsetCitation::latex(odocstream & os, OutputParams const & runparams) const
+void InsetCitation::latex(otexstream & os, OutputParams const & runparams) const
{
CiteEngine cite_engine = buffer().params().citeEngine();
BiblioInfo const & bi = buffer().masterBibInfo();
if (runparams.inulemcmd)
os << "}";
-
- return 0;
}
}
-docstring InsetCitation::contextMenu(BufferView const &, int, int) const
+docstring InsetCitation::contextMenuName() const
{
return from_ascii("context-citation");
}