Re: [textadept] XHTML

From: Robert <>
Date: Wed, 24 Aug 2011 20:54:18 +0200

On Wed, Aug 24, 2011 at 8:41 PM, mitchell <> wrote:
> Brian,
> On Tue, 23 Aug 2011, Brian Schott wrote:
>> I think that these files are still being identified as XML due to the
>> pattern that checks for "<?xml" at the beginning of the file. My
>> reading of mime_types.lua seems to confirm that patterns are checked
>> before file extensions. Can anyone else reproduce this?
> Yeah, file extension is the last check because patterns or sh bangs are more
> accurate for detecting file types than just extension. Obviously we have a
> corner case here. I'm not sure how I want to proceed.
> mitchell

Xhtml wants to be proper xml, so treat as such ;-)
As a workaround one could check for the occurrence of, for example
"<html>" in the file during set_buffer_properties of an xml module and
then switch the lexer if a tag is found. I used something similar to
switch from files with ".html" extension to the django lexer.

Received on Wed 24 Aug 2011 - 14:54:18 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 12:17:08 EST