From 64422b5b3790f134e9a2ffa25c4f8a8ea85c3a58 Mon Sep 17 00:00:00 2001 From: Vidar Date: Tue, 10 Dec 2019 09:28:50 +0100 Subject: [PATCH] Ensure elements contains child (#113) --- .../Resources/stylesheets/eZXml2Docbook_core.xsl | 8 +++----- .../Xslt/_fixtures/docbook/024-template.xml | 10 ++++++++-- .../richtext/input/161-eztemplate-no-content.xml | 13 +++++++++++++ .../richtext/log/161-eztemplate-no-content.log | 1 + .../_fixtures/richtext/output/160-eztemplate.xml | 4 +++- .../output/161-eztemplate-no-content.xml | 16 ++++++++++++++++ 6 files changed, 44 insertions(+), 8 deletions(-) create mode 100644 tests/lib/FieldType/Converter/_fixtures/richtext/input/161-eztemplate-no-content.xml create mode 100644 tests/lib/FieldType/Converter/_fixtures/richtext/log/161-eztemplate-no-content.log create mode 100644 tests/lib/FieldType/Converter/_fixtures/richtext/output/161-eztemplate-no-content.xml diff --git a/lib/FieldType/XmlText/Input/Resources/stylesheets/eZXml2Docbook_core.xsl b/lib/FieldType/XmlText/Input/Resources/stylesheets/eZXml2Docbook_core.xsl index 3290b824..ca3b821c 100644 --- a/lib/FieldType/XmlText/Input/Resources/stylesheets/eZXml2Docbook_core.xsl +++ b/lib/FieldType/XmlText/Input/Resources/stylesheets/eZXml2Docbook_core.xsl @@ -65,11 +65,9 @@ - - - - - + + + diff --git a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/024-template.xml b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/024-template.xml index 69fd0485..e8989506 100644 --- a/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/024-template.xml +++ b/tests/lib/FieldType/Converter/Xslt/_fixtures/docbook/024-template.xml @@ -32,6 +32,7 @@ + http://upload.wikimedia.org/wikipedia/commons/c/c6/R-S_mk2.gif 365 @@ -43,6 +44,11 @@ It is widely known that the bistable multivibrator hums z's in the middle octave key of E. - - + + + + + + + diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/input/161-eztemplate-no-content.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/input/161-eztemplate-no-content.xml new file mode 100644 index 00000000..95c8c7df --- /dev/null +++ b/tests/lib/FieldType/Converter/_fixtures/richtext/input/161-eztemplate-no-content.xml @@ -0,0 +1,13 @@ + +
+
+ +
+ + + + +
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/log/161-eztemplate-no-content.log b/tests/lib/FieldType/Converter/_fixtures/richtext/log/161-eztemplate-no-content.log new file mode 100644 index 00000000..c7b29a34 --- /dev/null +++ b/tests/lib/FieldType/Converter/_fixtures/richtext/log/161-eztemplate-no-content.log @@ -0,0 +1 @@ +warning:Custom tag 'linebreak' converted to block custom tag. It might have been inline custom tag in legacy DB where contentobject_attribute.id= diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/160-eztemplate.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/160-eztemplate.xml index 2d07d36d..b35ff49e 100644 --- a/tests/lib/FieldType/Converter/_fixtures/richtext/output/160-eztemplate.xml +++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/160-eztemplate.xml @@ -3,7 +3,9 @@ xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0-variant ezpublish-1.0"> - + + + custom tag content diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/161-eztemplate-no-content.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/161-eztemplate-no-content.xml new file mode 100644 index 00000000..7520ff7f --- /dev/null +++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/161-eztemplate-no-content.xml @@ -0,0 +1,16 @@ +
+ + + + + + + foobar + + +
+