Look at html purifier. Search, there is a version laravel ready. I forget the exact name.
How to make double curly brackets display as visual code/text.
On my site I'm doing a setup guide on how to code something.
To help the viewer understand the code it is being displayed visually in a code block with a syntax highlighter (prism.js) for easier viewing, and also so they can easily copy and paste it into their own project.
Problem is one line of the code text I need displayed to users just so happens to be surrounded with double curly braces and Laravel/blade assumes it is a Laravel related variable, so it converts it to a php echo and tries to grab/display it as such.
Is there any way I can display the double curly braces as viewable text, and get Laravel to not think it's a variable?
I've tried putting it into pre and code tags. I've tried putting an @{{ in front of it. tried /{{ I've tried echoing it. I've tried {{!!.
I've even tried using the { and } HTML entities, but somehow Laravel still sees it as curly braces and assumes it's a laravel variable.
I've tried combinations of the html entities and the curly braces. Even tried cancelling them out with periods between each one.
And everything seems to either throw a php error, or hide the line in the code block, or just show a blank page.
Searching online it seems this could have been done in older Laravel versions, but every option they list to try doesn't seem to work in 5.6
Is there any option to get double curly braces to show as text instead of laravel thinking it's a tag? or do I just have to screenshot the code and put it on my site as an image and make the client hand write it themselves?
Thank you.
Please or to participate in this conversation.