+ 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);
+ xs << html::EndTag("a");
+ return docstring();
+}
+
+
+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 type = getParam("type");
+ docstring guitype = _("www");
+ if (type == "mailto:")
+ guitype = _("email");
+ else if (type == "file:")
+ guitype = _("file");
+ return bformat(_("Hyperlink (%1$s) to %2$s"), guitype, url);