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

Add support for *.md.erb (like for Middleman), also inline attributes (like for Kramdown) #87

Closed spdustin closed 7 years ago

spdustin commented 9 years ago

This PR adds:

jonschlinkert commented 9 years ago

One concern I have is the similarity to Lo-Dash/Underscore templates. The regex you used would match all three Lo-Dash delimiters <%, <%- and <%=. If the highlighting looks great (and not busy or distracting), this would be a good thing.

I'll comment on a couple of other things, but I want to say thanks for doing the PR. I really appreciate it, and you did a great job. It's clean and it's nice that you updated the README. Thank you.

spdustin commented 9 years ago

This markup would only apply to the extensions in the header, so I wouldn't expect to see handlebars. It would only match <% followed by a space, btw, so yeah it would catch part of that lodash... Is there a way to limit match only to a specific extension? Maybe it needs to be a separate definition just for .md.erb files rather than the whole list.

I'd like to get it to a place of utility, though - I'm open to whatever suggestions. Let's figure this out!

spdustin commented 9 years ago

Makes me think tho... A master syntax spec that's included by multiple child specs that associate with .md.ext files, with each ext supporting the relevant template placeholders/tokens... I'm also investigating if the syntax can switch slightly based on the extension without having multiple definitions.

spdustin commented 9 years ago

The only way to limit the scope of the patterns within a syntax definition is by parent scope (I guess also by a header var, maybe?) so that means the only way to truly isolate these patterns to *.md.erb files would be to separate it into another syntax definition and just include text.html.markdown. Haven't tested including a package-installed syntax like that from the same package but I don't see why it wouldn't work.

What are your thoughts?

jonschlinkert commented 8 years ago

Wow really sorry, sometimes I just don't see these replies.

Haven't tested including a package-installed syntax like that from the same package but I don't see why it wouldn't work.

Sounds like a good idea, if you're still interested in this I'd be happy to collaborate on getting it to work

jonschlinkert commented 7 years ago

closing based on age and lack of response