[TxMt] Italics and Bold in Markdown.

Dan Lowe dan at tangledhelix.com
Thu Mar 22 04:51:25 UTC 2007


On Mar 21, 2007, at 7:27 PM, Luke Daley wrote:

> Ah. So when does the Markdown bundle use Markdown and when does it  
> use MultiMarkdown? And how can we differentiate between the two in  
> terms of language grammar?

The Markdown bundle contains two language grammars, one for Markdown  
and one for MultiMarkdown. If what you want is Markdown behavior,  
then the fix is easy: just set the language to Markdown.

The Preview and Convert to HTML commands behave differently depending  
on how you call them. If you are using the shortcut keys (⌃⌥⌘P  
and ⌃⇧H) to invoke them then they do the right thing based on the  
language setting for the current document. If you invoke them via the  
menu then it depends which individual command you invoke. The  
commands in the main Markdown menu relate to Markdown; there are  
MultiMarkdown commands in the MultiMarkdown submenu, and those will  
work according to MultiMarkdown rules. So using the shortcut keys  
it'll just work; using the menu it's possible to produce an improper  
result.


> I am happy to just make the modifications locally to suit myself if  
> this is not bothering anyone else. It may be worth fixing though as  
> it makes the syntax highlighting in TextMate misleading if it is  
> actually going to be piped through MultiMarkdown.

The problem is that the MultiMarkdown language grammar inherits its  
knowledge of italic/bold handling from the Markdown grammar, thus  
they highlight syntax the same way even if the output you get is  
different.

I was going to take a stab at fixing this but I took one look at the  
regex used for italic handling in Markdown and decided it was a bit  
more than I am going to try to absorb at this time of night. :-)

  -dan




More information about the textmate mailing list