jonschlinkert / sublime-markdown-extended

Top 100 Sublime Text plugin! Markdown syntax highlighter for Sublime Text, with extended support for GFM fenced code blocks, with language-specific syntax highlighting. YAML Front Matter. Works with ST2/ST3. Goes great with Assemble.
https://github.com/jonschlinkert
MIT License
660 stars 96 forks source link

Allow space before headings #163

Closed nachocab closed 7 years ago

nachocab commented 7 years ago

I would like to slightly modify the sublime-syntax file for personal use and allow an unlimited number of spaces before the # headings. I think this should be an easy modification, but the regexes in the file are a bit over my head. I was wondering if I could get a few pointers. This is what I've tried so far (without success):

Before:

heading:
  - match: '\G(#{1})(?!#)\s*(?=\S)'

After:

heading:
- match: '^ *\G(#{1})(?!#)\s*(?=\S)'
nachocab commented 7 years ago

Never mind, I figured it out: '\G *(#{1})(?!#)\s*(?=\S)'

Also, I had to remove the block_raw context