I have been a long time ST user and have recently decided to get into customizing it to better meet my needs.
I used the package resource viewer to extract a copy of the Markdown.sublime-syntax file.
I constructed the regex I want: “(#\S+)”
I am still learning how the syntax system works I added this context to the bottom:
hashtags:
- match: '([\#](?!\#)\S+)'
captures:
1: invalid.illegal.expected-eol.markdown
pop: true
Basically, I modelled it after the after-link-title context. I wanted to see if I could at least getting it highlighted in red before I ventured and learned how to modify the color scheme to show a yellow highlight around the the tags.
I am stuck and do not know where I would need to modify this file to get it working.
Also, is there any recommend “toy” files to play with to learn how the syntax highlighting works?
I did find a bug in the way sections are handled i.e. “# Section Header” works and this also works “#Section Header” notice the spacing. I was under the impression that there had to be a space after the #.
atx-heading:
- match: '(#)(?!#)\s+(?=\S)'
I replaced the * with a + and it seems to work better now.
In any case, I would appreciate some pointers on what to look for to get hashtags high lighting.