I have some content in database table (blog post) that is trusted content and I want to display on screen. This content is HTML and has some code samples using Prism.js for syntax highlighting. Because of the HTML econding on a gsp page I need to use the raw method to output the content as is
${raw(post.content)}
This works great except for when I get to the code that is wrapped in a tags for my code samples. Instead of showing it as code its outputting the raw html which is not what I want. I somehow need to encode the text that is inside of there because If I don't I end up with something that looks like this.

I know that I could do the encoding on save but I already have hundreds of posts where this is not the case. Any ideas?