#include "LaTeXFeatures.h"
#include "LyXFunc.h"
#include "OutputParams.h"
+#include "output_xhtml.h"
#include "ParIterator.h"
#include "sgml.h"
#include "TocBackend.h"
InsetRef::InsetRef(Buffer * buf, InsetCommandParams const & p)
- : InsetCommand(p, "ref"), isLatex(buf->isLatex())
+ : InsetCommand(buf, p, "ref"), isLatex(buf->isLatex())
{}
}
+docstring InsetRef::xhtml(XHTMLStream & xs, OutputParams const &) const
+{
+ // FIXME What we'd really like to do is to be able to output some
+ // appropriate sort of text here. But to do that, we need to associate
+ // some sort of counter with the label, and we don't have that yet.
+ docstring const ref = html::cleanAttr(getParam("reference"));
+ string const attr = "href=\"#" + to_utf8(ref) + "\"";
+ xs << StartTag("a", attr);
+ xs << ref;
+ xs << EndTag("a");
+ return docstring();
+}
+
+
void InsetRef::tocString(odocstream & os) const
{
plaintext(os, OutputParams(0));
}
-void InsetRef::updateLabels(ParIterator const & it)
+void InsetRef::updateLabels(ParIterator const & it, bool)
{
docstring const & label = getParam("reference");
// register this inset into the buffer reference cache.
break;
}
}
- screen_label_ += getParam("reference");
+ screen_label_ += label;
if (!isLatex && !getParam("name").empty()) {
screen_label_ += "||";