The logic is simple:
*Everything* that matches the expression inside the brackets is made upper case. Furthermore, the function treats all that text as plain text, not a mix of HTML and plain text. That means that because the output of the function is being put into an HTML file < and > get replaced by entities.
Or in other words, that function is not designed to be used in the way you are trying to use it.
You need to come up with a function that understands that it could be operating on a mixture of HTML tags and plain text and so restricts itself to only the plain text parts.
|