]> git.lyx.org Git - features.git/commitdiff
Fix bug #8156.
authorRichard Heck <rgheck@lyx.org>
Sun, 13 May 2012 17:49:24 +0000 (13:49 -0400)
committerRichard Heck <rgheck@lyx.org>
Sun, 13 May 2012 18:00:44 +0000 (14:00 -0400)
We want the key as id, not the label (which is optional).
We also need a kind of namespace for the citation ids.
We should also clean the id tag before using it.

src/insets/InsetBibitem.cpp
src/insets/InsetBibtex.cpp

index ac3c9149679b9073db7146afa1dfd2416e732c71..3b77c8e0a5938bd424f5562ec0e29f5ffdb3029f 100644 (file)
@@ -351,7 +351,7 @@ docstring InsetBibitem::xhtml(XHTMLStream & xs, OutputParams const &) const
        // need to use "name" anyway, eventually, because some browsers do not
        // handle jumping to ids. If we don't do that, though, we can just put the
        // id into the span tag.
-       string const attrs = "id='" + to_utf8(getParam("label")) + "'";
+       string const attrs = "id='LyXCite-" + to_utf8(getParam("key")) + "'";
        xs << html::CompTag("a", attrs);
        xs << html::StartTag("span", "class='bibitemlabel'");
        xs << bibLabel();
index 146d67cc83cf8d67843e8fc6db2e7d264d8b3a18..21e5f774adcd1eb013580b595e8152450ebf8652 100644 (file)
@@ -960,7 +960,7 @@ docstring InsetBibtex::xhtml(XHTMLStream & xs, OutputParams const &) const
                xs << html::StartTag("div", "class='bibtexentry'");
                // FIXME XHTML
                // The same name/id problem we have elsewhere.
-               string const attr = "id='" + to_utf8(entry.key()) + "'";
+               string const attr = "id='LyXCite-" + to_utf8(entry.key()) + "'";
                xs << html::CompTag("a", attr);
                docstring citekey;
                if (numbers)