]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetHyperlink.cpp
Routines for calculating numerical labels for BibTeX citations.
[lyx.git] / src / insets / InsetHyperlink.cpp
index 2c0192df998f3e1d4e5054e83fad571812bbd257..79908011fa1a28b4289591c7e72f5039a14adacf 100644 (file)
@@ -17,6 +17,7 @@
 #include "FuncRequest.h"
 #include "LaTeXFeatures.h"
 #include "OutputParams.h"
+#include "output_xhtml.h"
 
 #include "support/docstream.h"
 #include "support/gettext.h"
@@ -28,8 +29,8 @@ using namespace lyx::support;
 namespace lyx {
 
 
-InsetHyperlink::InsetHyperlink(InsetCommandParams const & p)
-       : InsetCommand(p, "href")
+InsetHyperlink::InsetHyperlink(Buffer * buf, InsetCommandParams const & p)
+       : InsetCommand(buf, p, "href")
 {}
 
 
@@ -181,6 +182,17 @@ int InsetHyperlink::docbook(odocstream & os, OutputParams const &) const
 }
 
 
+docstring InsetHyperlink::xhtml(XHTMLStream & xs, OutputParams const &) const
+{
+       docstring const & target = getParam("target");
+       docstring const & name   = getParam("name");
+       xs << StartTag("a", to_utf8("href=\"" + target + "\""));
+       xs << (name.empty() ? target : name);
+       xs << EndTag("a");
+       return docstring();
+}
+
+
 void InsetHyperlink::tocString(odocstream & os) const
 {
        plaintext(os, OutputParams(0));