}
-int InsetHyperlink::latex(odocstream & os,
- OutputParams const & runparams) const
+void InsetHyperlink::latex(otexstream & os,
+ OutputParams const & runparams) const
{
docstring url = getParam("target");
docstring name = getParam("name");
// output the ready \href command
os << "\\href{" << getParam("type") << url << "}{" << name << '}';
-
- return 0;
}
docstring InsetHyperlink::xhtml(XHTMLStream & xs, OutputParams const &) const
{
- docstring const & target = getParam("target");
+ docstring const & target =
+ html::htmlize(getParam("target"), XHTMLStream::ESCAPE_AND);
docstring const & name = getParam("name");
xs << html::StartTag("a", to_utf8("href=\"" + target + "\""));
xs << (name.empty() ? target : name);
}
-void InsetHyperlink::tocString(odocstream & os) const
+void InsetHyperlink::toString(odocstream & os) const
{
plaintext(os, OutputParams(0));
}
+void InsetHyperlink::forToc(docstring & os, size_t) const
+{
+ docstring const & n = getParam("name");
+ if (!n.empty()) {
+ os += n;
+ return;
+ }
+ os += getParam("target");
+}
+
+
docstring InsetHyperlink::toolTip(BufferView const & /*bv*/, int /*x*/, int /*y*/) const
{
docstring url = getParam("target");
}
-docstring InsetHyperlink::contextMenuName() const
+string InsetHyperlink::contextMenuName() const
{
- return from_ascii("context-hyperlink");
+ return "context-hyperlink";
}