Mark Wieder wrote:

function striptags tHtml
   replace cr with empty in tHtml -- in case of multi-line tags

   replace "<" with cr & "<" in tHtml
   replace ">" with ">" & cr in tHtml

   filter tHtml without "*<*"
   filter tHtml without "*>*"

   return tHtml
end striptags

Clever... but it'll fail on

if xyz > 4096 then

maybe replace the two filter lines with

   filter tHtml without "<*>"

This is a very interesting topic.

Being a lazy person, historically I've let the engine do the work by setting the htmlText of a field and then getting that field's text.

But given the overhead of field access, that might not benchmark as well as doing it in a variable as described here.

Are there any downsides to this approach? For example, how does it account for "<" and ">" which may appear in quoted strings or comments?

--
 Richard Gaskin
 Managing Editor, revJournal
 _______________________________________________________
 Rev tips, tutorials and more: http://www.revJournal.com
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to