ID:167611
 
Is there a way to disable text macros from being applied to text? I'm not wanting to use html_encode().
I have a way to do it by looping through text macros in a list and replacing the text macro with nothing, but I don't have a full list of text macro colors such as \red, \blue, etc.
Bump.
Artemio wrote:
but I don't have a full list of text macro colors such as \red, \blue, etc.


See the reference.
In response to Ben G
The reference doesn't have a full list.
In response to Artemio
Artemio wrote:
The reference doesn't have a full list.

Text macros start with '\' (a backslash) and end with a space or other punctuation.

\the, \The // insert 'the' (if needed)
\a, \an, // insert 'a(n)' or 'some' (if needed)
\A, \An

\he, \He // insert 'he/she/they/it'
\she, \She // same
\his, \His // insert 'his/her/their/its'
\him // insert 'him/her/them/it'
\himself // insert 'himself/herself/themself/itself'
\herself // same
\hers // insert 'his/hers/theirs/its'

\proper // used in an object name to force proper-noun behavior
\improper // used in an object name to force improper-noun behavior

\th // insert 1st, 2nd, 5th etc.
\s // insert 's' if [] was plural
\icon // insert icon of following []
\ref // insert a unique id for following []
\roman // insert following [] as a lower-case roman numeral
\Roman // insert following [] as an upper-case roman numeral
\... // suppress final new line
\n // insert new line
\" // insert double quote
\\ // insert backslash
\< // insert &lt; (less than)
\> // insert &gt; (greater than)
\(space) // skip a space
\(newline) // skip a newline (and following space)



All current text macros (not legacy).
In response to Ben G
That's all of them? Hm, wonder where \red and \green and \blue and \yellow are located in the reference, then.
In response to Artemio
Artemio wrote:
That's all of them? Hm, wonder where \red and \green and \blue and \yellow are located in the reference, then.

They're mentioned in html_encode (Note for BYOND oldies: the old-style formatting codes such as "\red" which are still parsed but not encouraged are completely stripped out by html_encode()), but they're legacy and no longer fully supported.
In response to Ben G
Regardless, that doesn't give me a full list of text macros like that.