From 00e3711c05234727792ad11b071ea486ec706378 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Wed, 27 Mar 2013 16:03:44 -0400 Subject: [PATCH] Clean id attributes for citations before outputting them. For some reason, this was done in trunk but never got to branch. --- src/insets/InsetBibtex.cpp | 3 ++- src/insets/InsetCitation.cpp | 2 +- status.20x | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp index bc853995a5..e2d059ec58 100644 --- a/src/insets/InsetBibtex.cpp +++ b/src/insets/InsetBibtex.cpp @@ -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) diff --git a/src/insets/InsetCitation.cpp b/src/insets/InsetCitation.cpp index b015363650..ec98cfb70a 100644 --- a/src/insets/InsetCitation.cpp +++ b/src/insets/InsetCitation.cpp @@ -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 "" + + return "" + html::htmlize(content, XHTMLStream::ESCAPE_ALL) + ""; } diff --git a/status.20x b/status.20x index 9050bc6106..8ce73a6192 100644 --- a/status.20x +++ b/status.20x @@ -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 -- 2.39.5