[TxMt] Re: [TextMate] htmlentitizing text

Nis Sarup nis.sarup at gmail.com
Fri Oct 29 09:50:11 UTC 2004


On Sun, 24 Oct 2004 16:14:27 +0200, Allan Odgaard <allan at macromates.com> wrote:
>     php -r 'echo htmlentities(stripslashes($_ENV["TM_SELECTED_TEXT"]),
> ENT_QUOTES, "UTF-8");'
> 

The above code didnt work for me. For some reason my $_ENV array was
empty, and the only site on the net with an answer to that, wanted me
to register to get  it.
So I messed around with the other variables and found that $_SERVER
also holds the TM_SELECTED_TEXT variable. So this works for me, quotes
and all:

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

>
> Not sure why you want the ENT_QUOTES option?
> 

Well, Im not exactly sure either. I have just always used that option
and have never had any problems with it. It might not be strictly
necesarry, but whats the hurt?

Oh, and by the way, I just pay for Textmate. It really is worth the
money. Even after the first of November.



More information about the textmate mailing list