[TxMt] Bug when drag and drop of an image file ?

Allan Odgaard allan at macromates.com
Mon Jul 11 18:43:49 UTC 2005


On 08/07/2005, at 18.35, Ned Baldessin wrote:

> Just a thought : is there a way to make the inserted tag consistent
> with the context, so HTML if the DOCTYPE is HTML, and XHTML if the
> DOCTYPE is XHTML ?

Sort of… the way it's designed to work is that the drag command is  
based on the scope. So you'd want to have one drag command for the  
text.html scope, and another for text.xhtml (there's an XHTML  
language grammar on the subversion repository).

A problem with this approach is however that the language  
autodetection feature of TextMate uses either hte file extension or  
the first line of the file, which often isn't enough to tell XHTML  
from HTML -- another approach would be to have the drag command do a  
grep on $TM_FILEPATH, to check the DOCTYPE, but the pragmatic  
solution would probably be to always insert an HTML compatible XHTML  
tag.




More information about the textmate mailing list