[TxMt] PHP vs XHTML?

Allan Odgaard throw-away-1 at macromates.com
Wed Nov 1 01:38:45 UTC 2006


On 1. Nov 2006, at 02:25, Sean Schertell wrote:

> Thanks for the tip Soryu but I'm a little confused. I should use  
> the HTML bundle instead of the XHTML bundle when I'm editing XHTML?

There is no (official) XHTML bundle. Only an HTML bundle and an  
Experimental Strict XHTML grammar (on the repository) -- the latter  
is strict, and thus does not allow any stuff that would be filtered  
out (or evaluated) by a preprocessor (other than XML preprocessing  
instructions), which includes PHP.

> One thing I noticed straight away is that when I use the Ctl-Return  
> shortcut for a line break, I get the old "<br>" instead of XHTML  
> valid "<br />".

Yes -- all tags inserted now insert by default as HTML, unless you  
set TM_XHTML to “/” (or “ /” if you want to produce somewhat HTML  
compatible XHTML) in the Shell Variables preferences that Soryu  
mentioned.

In the future this variable will likely automatically be set for  
documents with an XHTML document type, but for now, you need to set  
it yourself.

> Surely, it's not an unusual requirement to edit documents with  
> XHTML and PHP in them -- is there really no way to get TM to play  
> nice with this combination?

What was not nice about using the HTML grammar, other than having  
HTML shown in the status bar (but I assume that you are anyway  
sending these as text/html, so effectively you are creating documents  
which are interpreted as HTML (not XHTML) by the browsers which  
receive them, even though you are filling them with slashes ;) ).






More information about the textmate mailing list