#80422TYPO3 8.6.1 mixing FLUID and JS - CDATA doesn't work as before
Description
This worked until 7.6 but in 8.6.1 CDATA seems to have a different behavior inside a Fluidtemplate.
Inside the CDATA-section {s} and {z} are not escaped but omitted.
<script><br />var lati = {field.lati};<br />var longi = {field.longi}; <br />var map = L.map(‘map’, {zoomControl: false}).setView([{field.lati}, {field.longi}], 13);</p> <p><![CDATA[<br /> L.tileLayer('http://{s}.tiles.mapbox.com/v3/uhradone.ija63bia/{z}/{x}/{y}.png', {<br /> attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>‘,<br /> maxZoom: 18<br />}).addTo(map);</p> <p>]]></p> <p></script>
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 7
-
Jan Greth commented 08/25/17, 14:31
-
Benni Mack changed project id TYPO3 Version 8 10/27/17, 17:28
-
Andreas Kießling commented 01/07/18, 20:20
I don’t know if the description from Thomas is what i stumpled up on: CDATA blocks are completely omitted from my output.
AFAIR they were not touched at all in previous versions, which was sometimes needed if the output contains a lot of curly braces and Fluid would choke on it otherwise. -
Andreas Kießling commented 01/07/18, 20:22
Might also be linked to #75138
-
Susanne Moog changed category 01/24/18, 20:03
-
Riccardo De Contardi commented 01/31/20, 15:14
<f:format.cdata>or the instruction{parsing off}can be of help here? (I didn’t test by myself). -
Georg Ringer commented and changed status
NewClosed 06/06/24, 23:37Closing this because nothing will change there. Having inline code is bad anyway – I strongly suggest to use data attributes to hand data to JS and have the JS code as external file included.
Same Bug occures here in CMS 8.7.4 – Are there any news?
Thomas Hezel wrote:
> This worked until 7.6 but in 8.6.1 CDATA seems to have a different behavior inside a Fluidtemplate.
> Inside the CDATA-section {s} and {z} are not escaped but omitted.
>
> <script><br />> var lati = {field.lati};<br />> var longi = {field.longi}; <br />> var map = L.map(‘map’, {zoomControl: false}).setView([{field.lati}, {field.longi}], 13);<br />> <br />> <br />> <![CDATA[<br />> L.tileLayer(‘<a href="http://{s}.tiles.mapbox.com/v3/uhradone.ija63bia/{z}/{x}/{y}.png’" target="_blank" rel="noreferrer">http://{s}.tiles.mapbox.com/v3/uhradone.ija63bia/{z}/{x}/{y}.png’</a>, {<br />> attribution: ‘Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>‘,<br />> maxZoom: 18<br />> }).addTo(map); <br />> <br />> <br />> ]]> <br />> <br />> </script>