[LyX/master] DocBook: use the same normalisation for biblio IDs and their references.

Thibaut Cuvelier tcuvelier at lyx.org
Fri Oct 30 00:30:56 UTC 2020


commit df0ea858eda69bfaae0be4c09374f5105a93a76b
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Tue Oct 27 00:49:26 2020 +0100

    DocBook: use the same normalisation for biblio IDs and their references.
---
 development/autotests/invertedTests |    5 ++++-
 src/output_docbook.cpp              |    3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/development/autotests/invertedTests b/development/autotests/invertedTests
index 263d90f..ed107c6 100644
--- a/development/autotests/invertedTests
+++ b/development/autotests/invertedTests
@@ -417,6 +417,9 @@ export/export/latex/textcyr-textgreek-test_docbook5
 export/examples/.*/Graphics_and_Insets/XY-Figure_docbook5
 # - Formula in <code> tags.
 export/examples/.*/Graphics_and_Insets/XY-Pic_docbook5
+export/examples/.*/Graphics_and_Insets/XY-Figure_docbook5
+# - Formula in <code> tags.
+export/examples/.*/Graphics_and_Insets/XY-Pic_docbook5
 # - Math macros not implemented.
 export/mathmacros/testcases_speed_docbook5
 export/mathmacros/testcases_environments_docbook5
@@ -445,5 +448,5 @@ export/templates/Posters/.*_docbook5
 Sublabel: docbook beamer
 # Beamer is not yet implemented.
 export/examples/Presentations/.*_docbook5
-export/templates/Presentations/.*_docbook5
 export/templates/.*/Presentations/Beamer_docbook5
+export/templates/Presentations/.*_docbook5
diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp
index 74904e1..e9bd621 100644
--- a/src/output_docbook.cpp
+++ b/src/output_docbook.cpp
@@ -376,7 +376,8 @@ void makeBibliography(
 		if (!ip)
 			continue;
 		if (const auto * bibitem = dynamic_cast<const InsetBibitem*>(ip)) {
-			attr = from_utf8("xml:id='") + bibitem->getParam("key") + from_utf8("'");
+			auto id = xml::cleanID(bibitem->getParam("key"));
+			attr = from_utf8("xml:id='") + id + from_utf8("'");
 			break;
 		}
 	}


More information about the lyx-cvs mailing list