ID:168181
 
To start off, I'd like to say I suck with text handling functions in terms of findtext(), copytext(), and such, so if you give me a system I would very much appreciate comments or some explination on how it functions.

Now, what I'm trying to do here is is make a proc that will take a text string argument and eventually return a processed text string.
The way I want this process to work is somehow, check for certain HTML tags in a list and if there is an instance of that tag, replace it with, for an example; <font size becomes &lt;font size.
hub://Deadron.TextHandling has the nice dd_replacetext() procedure. :)
In response to Jon88
That works great, but one problem.
proc/process(s)
var/a=trim(copytext(s,1,500))
s=dd_replacetext(dd_replacetext(a,"<font size","&lt;font size"),"<font face","&lt;font face")
return s


That would return, if s is <font size=3>Testing.</font>, <font size=3>Testing, and same thing for the other check.

Another problem, pointed out by Dever, you could type in, say.. &;nbsp;&nbsp;&nbsp;&nbsp;size=10>Testing.</ font>, and it would parse the html tag.
One word: Wizkidd.

_Ryan
Would html_encode() work for you?
In response to IainPeregrine
Wizkidd's library fixed it.
But html_encode() is not what I wanted, because html_encode() textifies all html tags.