View Single Post
07/25/19, 01:40 PM   #7
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
So I did a little bit of testing with the filter edit box in inventory, which I guess doesn't use any explicit EscapeMarkup, only default control behaviour. I was too lazy to type out the mnemonics so I just used SetAllowMarkupType(n) -- assuming 0=NONE 1=COLOR_ONLY 2=ALL.

When allowed markup is NONE, you can type anything and it shows up.
If you then set allowed markup to COLOR_ONLY or ALL, |cXXXXXX and |r don't show up as you type it, and change the color of the text (and also differently colored letters seem wrongly placed, too close), BUT what you typed before with NONE stays as is. And if you change back to NONE, colored text remains colored.

Links behave differently.
With allowed markup set to NONE, they turn into links if you PASTE them as a whole (i.e. manually Ctrl+V or SetText() or InsertText())
For example this inserts an item link in small chunks, none of which contain | followed by a character, and the text stays as non-link:
Lua Code:
  1. for chunk in string.gmatch(itemLink, "[^|]*.") do
  2.   editBox:InsertText(chunk)
  3. end
Perhaps this could be abused to "unlinkify" the text after Ctrl+V, but it sounds wrong, I doubt that's worth it.
  Reply With Quote