+ docstring const & target =
+ xml::escapeString(getParam("target"), XMLStream::ESCAPE_AND);
+ docstring const & name = getParam("name");
+ xs << xml::StartTag("a", to_utf8("href=\"" + target + "\""));
+ xs << (name.empty() ? target : name);
+ xs << xml::EndTag("a");
+ return docstring();
+}
+
+
+void InsetHyperlink::toString(odocstream & os) const
+{
+ odocstringstream ods;
+ plaintext(ods, OutputParams(0), INT_MAX);
+ os << ods.str();
+}
+
+
+void InsetHyperlink::forOutliner(docstring & os, size_t const, bool const) 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);