I am using the hosted version of Ghost. I am using a piece of custom code to render interactive graphs inside the body of the text.
To do this, I am setting the data attributes of an HTML element that the custom code can read to set the values of a graph. This is working perfectly when I am previewing my posts, however when I publish the code, the values of the HTML data attributes are getting mangled and converted into lower case (which means my code can’t read them).
For example, I am adding this to an HTML block in the editor:
<div class="blog-graph-root" data-graph-type="pie" data-graph-name='The "all-in" cost of a grant'
data-graph-data='[ { "name": "Not applying", "value": 1700 }, { "name": "Applicants", "value": 1400 }, { "name": "Reporting", "value": 500 }, { "name": "Funder Costs", "value": 3000 } ]'></div>
This is then being converted into:
<div class="blog-graph-root" data-graph-type="pie" data-graph-name="The " all-in"="" cost="" of="" a="" grant"="" data-graph-data="[ { " name":="" "not="" applying",="" "value":="" 1700="" },="" {="" "name":="" "applicants",="" 1400="" "reporting",="" 500="" "funder="" costs",="" 3000="" }="" ]"=""></div>