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
659 stars 96 forks source link

using --- automatically trigger yaml syntax even if there was no ` or ```yaml #89

Open oriSomething opened 9 years ago

oriSomething commented 9 years ago
normal text here

---
everything here is  a yaml syntax

it's a problem because --- is used as a separator.

by the way, thanks! this project makes markdown usable in sublime text

jonschlinkert commented 9 years ago

yeah this was a pain initially, I tried to find a compromise but it seems to be a no-win scenario from an implementation standpoint - well, more of a tradeoff...

Since --- is commonly used in front matter - jekyll, assemble, metalsmith, verb, etc, and front matter is used for data, IMHO it's better to err on the side of providing a better experience for users who need to see their data highlighted, versus a separator. Because of this, I personally use ***, instead of---`. It works the same and everyone wins.

That said, I'm totally open to a solution that distinguishes front-matter from other separators in ST. I'm by no means an expert

oriSomething commented 9 years ago

but maybe there is a hack, the ability to chose what languages supported manually. than we can disable the problematic languages when they're not being used. also it might be helpful, so we can use built in languages support for this scope. (not sure if it's supported but i believe it is):

{
 "javascript": "js",
 "python": "python"
 ...
}