From 9111ffdf46285c8b09f03a2139f6c3f7d0c02ff9 Mon Sep 17 00:00:00 2001 From: Konrad Oboza <34310128+konradoboza@users.noreply.github.com> Date: Fri, 7 Feb 2020 16:10:41 +0100 Subject: [PATCH] EZP-31272: Handled anchors generated with name attribute (#107) * EZP-31272: Handled anchors generated with name attribute * added checking whether anchor names can be mapped to id uniqueness wise * intentional failed test to check duplicated name attributes * validation and tests reworked to strip anchors having duplicated names --- .../Resources/stylesheets/xhtml5/edit/docbook.xsl | 14 +++++++++++--- .../xhtml5/edit/lossy/008-anchor.docbook.xml | 11 +++++++++++ .../xhtml5/edit/lossy/008-anchor.xhtml5.edit.xml | 6 ++++++ 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/lossy/008-anchor.docbook.xml create mode 100644 tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/lossy/008-anchor.xhtml5.edit.xml diff --git a/src/lib/eZ/RichText/Resources/stylesheets/xhtml5/edit/docbook.xsl b/src/lib/eZ/RichText/Resources/stylesheets/xhtml5/edit/docbook.xsl index 298ec2fa..a42b82b0 100644 --- a/src/lib/eZ/RichText/Resources/stylesheets/xhtml5/edit/docbook.xsl +++ b/src/lib/eZ/RichText/Resources/stylesheets/xhtml5/edit/docbook.xsl @@ -255,20 +255,28 @@ + - + - + - + + + + + + + + diff --git a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/lossy/008-anchor.docbook.xml b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/lossy/008-anchor.docbook.xml new file mode 100644 index 00000000..270e5b12 --- /dev/null +++ b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/lossy/008-anchor.docbook.xml @@ -0,0 +1,11 @@ + + + some anchor with a name attribute. + some anchor with a name attribute. + another anchor that should be removed due to lack of name uniqueness. + diff --git a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/lossy/008-anchor.xhtml5.edit.xml b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/lossy/008-anchor.xhtml5.edit.xml new file mode 100644 index 00000000..e5d9792e --- /dev/null +++ b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/lossy/008-anchor.xhtml5.edit.xml @@ -0,0 +1,6 @@ + + + some anchor with a name attribute. + some anchor with a name attribute. + another anchor that should be removed due to lack of name uniqueness. +
some anchor with a name attribute.
another anchor that should be removed due to lack of name uniqueness.