[TextMate] htmlentitizing text

Allan Odgaard allan at macromates.com
Sun Oct 24 14:14:27 UTC 2004


On 24. Oct 2004, at 16:00, Allan Odgaard wrote:

>> If you only work with latin-1 characters, you could make the command 
>> like this (two lines):
> I just read the PHP manual for htmlentities [...]

I knew I couldn't leave this one alone... the command I gave has a 
problem if the selected text has an apostrophe due to quoting, here's a 
command that should work:

    php -r 'echo htmlentities(stripslashes($_ENV["TM_SELECTED_TEXT"]), 
ENT_QUOTES, "UTF-8");'

Not sure why you want the ENT_QUOTES option?


Kind regards Allan




More information about the textmate mailing list