diff --git a/src/bundle/Resources/views/RichText/embed/content.html.twig b/src/bundle/Resources/views/RichText/embed/content.html.twig index 918f61f5..b25f77c1 100644 --- a/src/bundle/Resources/views/RichText/embed/content.html.twig +++ b/src/bundle/Resources/views/RichText/embed/content.html.twig @@ -5,7 +5,8 @@ {% if embedParams.link is defined %} {% set params = params|merge( { "linkParameters": embedParams.link } ) %} {% endif %} -
+ +
{{ fos_httpcache_tag('relation-' ~ embedParams.id) }} {{ render( diff --git a/src/bundle/Resources/views/RichText/embed/location.html.twig b/src/bundle/Resources/views/RichText/embed/location.html.twig index 93ed0199..368e2448 100644 --- a/src/bundle/Resources/views/RichText/embed/location.html.twig +++ b/src/bundle/Resources/views/RichText/embed/location.html.twig @@ -5,7 +5,8 @@ {% if embedParams.link is defined %} {% set params = params|merge( { "linkParameters": embedParams.link } ) %} {% endif %} -
+ +
{{ fos_httpcache_tag('relation-location-' ~ embedParams.id) }} {{ render( diff --git a/src/lib/eZ/RichText/Converter/Render/Embed.php b/src/lib/eZ/RichText/Converter/Render/Embed.php index 41c50859..8ab02ce4 100644 --- a/src/lib/eZ/RichText/Converter/Render/Embed.php +++ b/src/lib/eZ/RichText/Converter/Render/Embed.php @@ -122,6 +122,7 @@ protected function extractParameters(DOMElement $embed, $tagName) $class = $embed->getAttribute('ezxhtml:class'); $align = $embed->getAttribute('ezxhtml:align'); + $anchor = $embed->getAttribute('xml:id'); $linkParameters = $this->extractLinkParameters($embed); $configuration = $this->extractConfiguration($embed); @@ -130,6 +131,10 @@ protected function extractParameters(DOMElement $embed, $tagName) 'viewType' => $viewType, ]; + if (!empty($anchor)) { + $parameters['anchor'] = $anchor; + } + if (!empty($class)) { $parameters['class'] = $class; } diff --git a/src/lib/eZ/RichText/Resources/stylesheets/docbook/xhtml5/edit/core.xsl b/src/lib/eZ/RichText/Resources/stylesheets/docbook/xhtml5/edit/core.xsl index bd43cef7..0b4631b7 100644 --- a/src/lib/eZ/RichText/Resources/stylesheets/docbook/xhtml5/edit/core.xsl +++ b/src/lib/eZ/RichText/Resources/stylesheets/docbook/xhtml5/edit/core.xsl @@ -26,6 +26,11 @@ + + + + + @@ -42,6 +47,11 @@ + + + + + @@ -235,6 +245,11 @@ + + + + + @@ -251,6 +266,11 @@ + + + + + @@ -262,6 +282,11 @@ + + + + + @@ -284,6 +309,11 @@ + + + + + diff --git a/src/lib/eZ/RichText/Resources/stylesheets/docbook/xhtml5/output/core.xsl b/src/lib/eZ/RichText/Resources/stylesheets/docbook/xhtml5/output/core.xsl index a9b98f4c..4c6c1cee 100644 --- a/src/lib/eZ/RichText/Resources/stylesheets/docbook/xhtml5/output/core.xsl +++ b/src/lib/eZ/RichText/Resources/stylesheets/docbook/xhtml5/output/core.xsl @@ -20,6 +20,11 @@ + + + + + @@ -43,6 +48,11 @@ + + + + + @@ -247,6 +257,11 @@ + + + + + @@ -258,6 +273,11 @@ + + + + + @@ -269,6 +289,11 @@ + + + + + @@ -291,6 +316,11 @@ + + + + + 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 8570f452..93c2761a 100644 --- a/src/lib/eZ/RichText/Resources/stylesheets/xhtml5/edit/docbook.xsl +++ b/src/lib/eZ/RichText/Resources/stylesheets/xhtml5/edit/docbook.xsl @@ -48,6 +48,11 @@ + + + + + @@ -90,6 +95,11 @@ + + + + + @@ -247,6 +257,11 @@ + + + + + @@ -266,6 +281,11 @@ + + + + + @@ -277,6 +297,11 @@ + + + + + @@ -311,6 +336,11 @@ + + + + + diff --git a/tests/lib/eZ/RichText/Converter/Render/EmbedTest.php b/tests/lib/eZ/RichText/Converter/Render/EmbedTest.php index 9146d38e..f7b0df76 100644 --- a/tests/lib/eZ/RichText/Converter/Render/EmbedTest.php +++ b/tests/lib/eZ/RichText/Converter/Render/EmbedTest.php @@ -87,6 +87,7 @@ public function providerForTestConvert() ], 'class' => 'embed-class', 'align' => 'left', + 'anchor' => 'embed-id-1', ], ], ], diff --git a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/002-para.xml b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/002-para.xml index d717b1d5..e1c83208 100644 --- a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/002-para.xml +++ b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/002-para.xml @@ -10,4 +10,5 @@ This is a centered paragraph. This is a right aligned paragraph. This is a justified paragraph. + This is a paragraph with id diff --git a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/008-orderedList.xml b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/008-orderedList.xml index 8e9d8ae8..8acdc7b6 100644 --- a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/008-orderedList.xml +++ b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/008-orderedList.xml @@ -4,7 +4,7 @@ xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0"> - + This is a list item. diff --git a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/009-itemizedList.xml b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/009-itemizedList.xml index 11559d6a..a87817ed 100644 --- a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/009-itemizedList.xml +++ b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/009-itemizedList.xml @@ -4,7 +4,7 @@ xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0"> - + This is a list item. diff --git a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/010-htmlInformaltable.xml b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/010-htmlInformaltable.xml index 01cd6f14..793a12c4 100644 --- a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/010-htmlInformaltable.xml +++ b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/010-htmlInformaltable.xml @@ -4,7 +4,7 @@ xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0"> - + diff --git a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/011-htmlTable.xml b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/011-htmlTable.xml index 3875abf8..362d3323 100644 --- a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/011-htmlTable.xml +++ b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/011-htmlTable.xml @@ -4,7 +4,7 @@ xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0"> - +
diff --git a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/033-programlisting.xml b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/033-programlisting.xml index 0e8f4e6e..44b852be 100644 --- a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/033-programlisting.xml +++ b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/docbook/033-programlisting.xml @@ -17,4 +17,5 @@ thisIsSomePHPCode(); return 0; } + and some more text here]]> diff --git a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/002-para.xml b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/002-para.xml index 7650b233..66524b6b 100644 --- a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/002-para.xml +++ b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/002-para.xml @@ -6,4 +6,5 @@

This is a centered paragraph.

This is a right aligned paragraph.

This is a justified paragraph.

+

This is a paragraph with id

diff --git a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/008-orderedList.xml b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/008-orderedList.xml index 5242b7f1..d2241c1f 100644 --- a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/008-orderedList.xml +++ b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/008-orderedList.xml @@ -1,6 +1,6 @@
-
    +
    1. This is a list item.
diff --git a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/009-itemizedList.xml b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/009-itemizedList.xml index 075ab479..832bec2a 100644 --- a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/009-itemizedList.xml +++ b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/009-itemizedList.xml @@ -1,6 +1,6 @@
-
    +
    • This is a list item.
diff --git a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/010-htmlInformaltable.xml b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/010-htmlInformaltable.xml index 3c32cf24..7eb5442b 100644 --- a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/010-htmlInformaltable.xml +++ b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/010-htmlInformaltable.xml @@ -1,6 +1,6 @@
-
Table caption.
+
diff --git a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/011-htmlTable.xml b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/011-htmlTable.xml index c661a7d6..b7db0ece 100644 --- a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/011-htmlTable.xml +++ b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/011-htmlTable.xml @@ -1,6 +1,6 @@
- +
diff --git a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/033-programlisting.xml b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/033-programlisting.xml index 4de9a8a5..7c8eb4fb 100644 --- a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/033-programlisting.xml +++ b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/edit/033-programlisting.xml @@ -18,4 +18,5 @@ thisIsSomePHPCode(); return 0; } +
Literal with CNAME end sequence here : ]]> and some more text here
diff --git a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/002-para.xml b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/002-para.xml index fa242002..f139ec59 100644 --- a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/002-para.xml +++ b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/002-para.xml @@ -1,9 +1,10 @@
-

This is a heading.

-

This is a paragraph.

-

This is a left aligned paragraph.

-

This is a centered paragraph.

-

This is a right aligned paragraph.

-

This is a justified paragraph.

+

This is a heading.

+

This is a paragraph.

+

This is a left aligned paragraph.

+

This is a centered paragraph.

+

This is a right aligned paragraph.

+

This is a justified paragraph.

+

This is a paragraph with id

diff --git a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/008-orderedList.xml b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/008-orderedList.xml index 020cab1e..a8717e20 100644 --- a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/008-orderedList.xml +++ b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/008-orderedList.xml @@ -1,6 +1,6 @@
-
    +
    1. This is a list item.
diff --git a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/009-itemizedList.xml b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/009-itemizedList.xml index 4e16208e..52fd7485 100644 --- a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/009-itemizedList.xml +++ b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/009-itemizedList.xml @@ -1,6 +1,6 @@
-
    +
    • This is a list item.
diff --git a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/010-htmlInformaltable.xml b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/010-htmlInformaltable.xml index 4a595668..e9dfa97a 100644 --- a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/010-htmlInformaltable.xml +++ b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/010-htmlInformaltable.xml @@ -1,6 +1,6 @@
-
Table caption.
+
diff --git a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/011-htmlTable.xml b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/011-htmlTable.xml index 64385b79..78525d93 100644 --- a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/011-htmlTable.xml +++ b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/011-htmlTable.xml @@ -1,6 +1,6 @@
- +
diff --git a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/033-programlisting.xml b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/033-programlisting.xml index 245340a4..4c740349 100644 --- a/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/033-programlisting.xml +++ b/tests/lib/eZ/RichText/Converter/Xslt/_fixtures/xhtml5/output/033-programlisting.xml @@ -18,4 +18,5 @@ thisIsSomePHPCode(); return 0; } +
Literal with CNAME end sequence here : ]]> and some more text here
Table caption.