View Single Post
Old 12-31-2014, 10:45 AM   #18
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
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.
kovidgoyal is online now   Reply With Quote