6 09, 2019

Output HTML Syntax Characters from RSS Feeds to Preview Correctly for Cascade

By | 2019-09-06T09:25:33+00:00 September 6th, 2019|Categories: Web Development|Tags: , , , |

This applies to Cascade Velocity formats. If you’ve ever had to pull in content through an external feed that has rich HTML, this piece of code may help you. Sometimes you may see HTML tags or code output into the content of the page. Such as, <Content goes here.>.

This code will take the HTML syntax you would like to replace and output as standard HTML tags, so that when a user looks at the page, it’s properly formatted for them using the HTML provided in the feed.

With this code you can continue to add or daisy chain replaceAll code, as needed.

Example code to update:

$_SerializerTool.serialize($departmentContent, true).replaceAll(“&lt;”, “<“).replaceAll(“&gt;”, “>”)