]> 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:02:10 +0000 (14:02 -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.

(cherry picked from commit 207d7e4ada31d521b75e9290575b97b6bb1e8c38)

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

index d3a10ae63c645bb653a161109434dc75047e42ac..5fe5e10528b2bb91b8cd19417179addc5fbaaf1c 100644 (file)
@@ -348,7 +348,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 294ea939ba7656db967c4870c7f98e7b00ea9620..0e80857288c05992f385fd454092d74ba2c49962 100644 (file)
@@ -952,7 +952,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)