A quick query...
When working in Markdown, the language grammar only seems to pick up headings if they have a blank line (or another heading) above them. So for instance, this:
# Heading 1 ## Heading 2 some text here
## Heading 3 some text here
... is fine, and all headings are recognised as such and coloured correctly. However, I use { and } in my Markdown documents to enable folding, and this:
# Heading 1 ## Heading 2 { some text here } ## Heading 3 { some text here }
... would make Heading 3 not be picked up as a heading, even though the Markdown script will pick it up as such and convert to HTML properly.
Is it possible to change the language grammar so that the headings with no blank line above are picked up? At the moment I have to leave a blank line between all my folded text and I'd like not to have to. I've had a go at this but my regex-fu is not strong and I ended up breaking all the highlighting...
Many thanks, Nigel
On Jan 16, 2008, at 9:52 AM, Nigel Green wrote:
Is it possible to change the language grammar so that the headings with no blank line above are picked up? At the moment I have to leave a blank line between all my folded text and I'd like not to have to. I've had a go at this but my regex-fu is not strong and I ended up breaking all the highlighting...
Just committed a fix for this. If your interested the reason it didn't work was the meta.paragraph block needed to look ahead to make sure it ended if a heading started the following line.
Super stuff - works like a charm! I'm always pleasantly surprised at how helpful and responsive the Textmate community is - many thanks, Michael.
Nigel
On 23 Jan 2008, at 06:49, Michael Sheets wrote:
On Jan 16, 2008, at 9:52 AM, Nigel Green wrote:
Is it possible to change the language grammar so that the headings with no blank line above are picked up? At the moment I have to leave a blank line between all my folded text and I'd like not to have to. I've had a go at this but my regex-fu is not strong and I ended up breaking all the highlighting...
Just committed a fix for this. If your interested the reason it didn't work was the meta.paragraph block needed to look ahead to make sure it ended if a heading started the following line.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
While we're on the subject of Markdown fixes...
Any chance of getting a fix for this one?:
- Make the "New Item" command respect the current style for lists
Right now, if you have a Markdown list like this:
- foo - bar - baz<caret>
pressing 'return' to create a new item adds a '*' before the first item and creates a new line beginning with '* ':
*- foo - bar - baz * <caret>
The expected behaviour would be:
- foo - bar - baz - <caret>
Thanks in advance : )