]> git.lyx.org Git - features.git/commitdiff
Clean id attributes for citations before outputting them.
authorRichard Heck <rgheck@lyx.org>
Wed, 27 Mar 2013 20:03:44 +0000 (16:03 -0400)
committerRichard Heck <rgheck@lyx.org>
Wed, 27 Mar 2013 20:05:09 +0000 (16:05 -0400)
For some reason, this was done in trunk but never got to
branch.

src/insets/InsetBibtex.cpp
src/insets/InsetCitation.cpp
status.20x

index bc853995a578c9d22e92899c303d45271da30f55..e2d059ec58fa1a4270b13e19bed485c5fb3c075b 100644 (file)
@@ -956,7 +956,8 @@ 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='LyXCite-" + to_utf8(entry.key()) + "'";
+               string const attr = "id='LyXCite-" + 
+                               to_utf8(html::cleanAttr(entry.key())) + "'";
                xs << html::CompTag("a", attr);
                docstring citekey;
                if (numbers)
index b01536365093e4d4f213f824fb3d7a2293321011..ec98cfb70a34b82cbbb04973bd52486d5f2b3280 100644 (file)
@@ -228,7 +228,7 @@ inline docstring wrapCitation(docstring const & key,
                return content;
        // we have to do the escaping here, because we will ultimately
        // write this as a raw string, so as not to escape the tags.
-       return "<a href='#LyXCite-" + key + "'>" +
+       return "<a href='#LyXCite-" + html::cleanAttr(key) + "'>" +
                        html::htmlize(content, XHTMLStream::ESCAPE_ALL) + "</a>";
 }
 
index 9050bc6106d919b9c5a0e2f2b482d2d2ee5714b6..8ce73a61926ec7160c8e25d144ec1eff1471d073 100644 (file)
@@ -129,6 +129,9 @@ What's new
 
 - Fix problem with HTML output of simple formulas like "y[i]" (bug 8609).
 
+- Clean ids for citations before outputting them. Characters like ":" are
+  not allowed in HTML identifiers, apparently (bug 8606).
+
 
 * USER INTERFACE