I am working on an add-on which has some configurable options in the Admin CP which are then inserted into javascript using the following code:
The default text of my text box contains this, for example.
The source of the page looks like this, for example.
So the apostrophe isn't escaped, breaking the javascript. In my mind, jsescape should escape the apostrophes properly like it does with the </p> tag.
I am working around this at the moment to have the default text with words such as does not instead of doesn't.
Code:
{xen:jsescape {xen:raw $xenOptions.myAddOnFullText}}
The default text of my text box contains this, for example.
Code:
<p>The default text of my text box contains HTML which is escaped properly but also doesn't escape apostrophes properly</p>
The source of the page looks like this, for example.
HTML:
<script>fulltext: '<p>The default text of my text box contains HTML which is escaped properly but also doesn't escape apostrophes properly<\/p>'</script>
So the apostrophe isn't escaped, breaking the javascript. In my mind, jsescape should escape the apostrophes properly like it does with the </p> tag.
I am working around this at the moment to have the default text with words such as does not instead of doesn't.