I have hand coded my blog, no wordpress or anything, and I am trying to make a feature that would allow me to write code in my blog and display it like: <div>Like This</div>
I am probably thinking about it way to much, it might be simpler than I think. What I was trying to do was just find <code></code> tags in the blog post and replace all the < with $lt; and > with >, etc. that were found inside the <code></code> tags. But I could think of a way where it would do it for multiple <code></code> tags.
Then at the very end of the code I would replace <code></code> with <div class="code"></div>
Is there a better way to do this? Thanks guys!
1 Answer