How-To Use Valid XHTML Tags in TextMate
Written by Jon Henshaw | Posted on March 27th, 2007
Here’s a tip I just now found out about. In TextMate, the HTML bundle has a ton of available snippets. Unfortunately, they don’t automatically add the closing trailing slash for certain elements. For example, instead of inserting
<br/> or <input type="text"/>
TextMate inserts
<br> or <input type="text">
(Note the missing trailing slashes.)
You can change this behavior by going to
- TextMate Preferences → Advaned → Shell Variables
- Create a new variable called “TM_XHTML” with value “/” (no quotes)
Now TextMate will output valid XHTML when you use the HTML bundle. Here’s a screenshot showing the correct setup. Hope this helps!




