[Journal - Markup Entities]

Markup Entities

Thursday, March 10, 2005

In the last post, I wondered how I'd efficiently encode HTML entities when editing text. Well, the functionality is already there. Suppose you have a function "EncodeEntities(String) : String" that does it (there's one in Gregor.Core.Parse), all you need is to place the following token in the token list, select it, select the text to encode, and press Ctrl+Shift+T:

$TextServices.EncodeEntities(Vars.TextSelection)%

It's always a gratifying experience to find out that your tools are used in ways not foreseen when you created then.