Clean id attributes for citations before outputting them.

For some reason, this was done in trunk but never got to
branch.
This commit is contained in:
Richard Heck 2013-03-27 16:03:44 -04:00
parent 40da79fe73
commit 00e3711c05
3 changed files with 6 additions and 2 deletions

View File

@ -956,7 +956,8 @@ docstring InsetBibtex::xhtml(XHTMLStream & xs, OutputParams const &) const
xs << html::StartTag("div", "class='bibtexentry'"); xs << html::StartTag("div", "class='bibtexentry'");
// FIXME XHTML // FIXME XHTML
// The same name/id problem we have elsewhere. // 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); xs << html::CompTag("a", attr);
docstring citekey; docstring citekey;
if (numbers) if (numbers)

View File

@ -228,7 +228,7 @@ inline docstring wrapCitation(docstring const & key,
return content; return content;
// we have to do the escaping here, because we will ultimately // we have to do the escaping here, because we will ultimately
// write this as a raw string, so as not to escape the tags. // 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>"; html::htmlize(content, XHTMLStream::ESCAPE_ALL) + "</a>";
} }

View File

@ -129,6 +129,9 @@ What's new
- Fix problem with HTML output of simple formulas like "y[i]" (bug 8609). - 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 * USER INTERFACE