UserLand Software Home  |  Manila  |  Radio  |  Support  |  News

DocServer

Prev | Next | mainResponder Verbs > mainResponder.neuterText

mainResponder.neuterText

Syntax mainResponder.neuterText (s, flNeuterMacros, flNeuterTags)

Params s is a string.

flNeuterMacros is a boolean. Default: true.

flNeuterTags is a boolean. Default: true.

Action If flNeuterMacros is true, replace all occurences of opening curly brace "{" in s with the corresponding HTML entity. If the #enableSafeMacros attribute is defined and set to true, all macros are neutered except those specified in the config.mainResponder.prefs.legalMacros table. When the text that's running thru mainResponder.neuterText is rendered as a web page, this feature allows you to include any items in the rendered page that are in scope, including those that are in the page table.

If flNeuterTags is true, remove all tags which are not listed as legal in config.mainResponder.prefs.legalTags. Also make sure that legal tags are properly balanced, add closing tags at the end of s as neccessary.

Returns The modified string.

Examples mainResponder.neuterText ("<b>Beep</b>, {speaker.beep ()} <i>Beep!")

   » "&lt;Beep>, &#123;speaker.beep ()&#125; <i>Beep!</i>"

Notes You can use this verb to clean up any text which entered your system from the outside world to make rendering it through the website framework safer.

As of Frontier 6.1, the low-level work is done by the new html.neuterMacros and html.neuterTags kernel verbs.

See Also mainResponder.neuterOutline

html.neuterMacros

html.neuterTags

Prev | Next | mainResponder Verbs > mainResponder.neuterText