for Google Prettify to display HTML code sample properly, you should replace all the <
with <
and all the >
with >
.
How do you automate that process using JavaScript only ?
for Google Prettify to display HTML code sample properly, you should replace all the <
with <
and all the >
with >
.
How do you automate that process using JavaScript only ?
You could do a global replace to the content using a RegEx.
If you put your code inside an
<xmp>
element, you don't need to escape HTML special characters as shown in the tests