<div class="markdown">
<p dir="auto">On 5 Nov 2014, at 21:17, <a href="mailto:soeren.vogel@posteo.ch">soeren.vogel@posteo.ch</a> wrote:</p>

<blockquote>
<p dir="auto">How can I achieve syntax highlight for pandoc (multimarkdown) title elements (starting with '% Some title')?</p>
</blockquote>

<p dir="auto">The manual explains the system: <a href="http://manual.macromates.com/en/language_grammars">http://manual.macromates.com/en/language_grammars</a></p>

<p dir="auto">Matt Neuburg did a supplement: <a href="http://www.apeth.com/nonblog/stories/textmatebundle.html">http://www.apeth.com/nonblog/stories/textmatebundle.html</a></p>

<p dir="auto">The current rule for <code># Some title</code> in Markdown is:</p>

<pre><code>name = 'markup.heading.${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.markdown';
begin = '(?:^|\G)(#{1,6})\s*(?=[\S[^#]])';
end = '\s*(#{1,6})?$\n?';
captures = { 1 = { name = 'punctuation.definition.heading.markdown'; }; };
contentName = 'entity.name.section.markdown';
patterns = ( { include = '#inline'; } );
</code></pre>

<p dir="auto">The long format string in the <code>name</code> (<code>${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}</code>) is to convert the span if <code>#</code>’s to an integer (you probably don’t need that).</p>

</div>