[TxMt] Re: Language definition problem

Allan Odgaard mailinglist at textmate.org
Fri Nov 29 11:46:08 UTC 2013

On 26 Nov 2013, at 22:36, Gerd Knops wrote:

> […] as soon as I enabled the uncommented line that is supposed to 
> highlight the embedded documentation with markdown, markdown gobbles 
> up the end markers.
> Shouldn't the outer pattern prevent this?

The problem is that Markdown will do nested rules to track indent etc.

So you include a rule that does begin/end and stays inside the included 
rule’s children array when seeing the newline, which is why the outer 
rule’s end pattern is not being used.

> And if not, how can I make this work?

Including the markdown grammar as-is cannot be made to work. What could 
work is to only include inline styles from the markdown grammar, as 
it’s the block level elements that are problematic (and presumably 
they are problematic beyond the end marker, as for example, indented 
text is matched as raw, but your comment may itself add to this indent 
(that should be ignored by markdown)).

Disclaimer: I didn’t actually look through the markdown grammar. It 
might not be written for allowing including “just the inline 
styles”, but possibly some refactoring could allow it.

More information about the textmate mailing list