Sublime Forum

How to disable html in Markdown?

#1

In ST3, html snippets are getting in my way when writing Markdown. I constantly accept a HTML completion by accident. I am writing a lot of Markdown but need HTML only once in a blue moon. I am looking into completely disabling HTML snippets for Markdown. The scope is text.html.markdown.

For default HTML snippets I changed the original scope

<scope>text.html &amp; (- meta.tag | punctuation.definition.tag.begin)</scope>

into this

<scope>text.html &amp; (- meta.tag | punctuation.definition.tag.begin) - text.html.markdown</scope>

and it seems to work. I am unsure about the &amp; and parenthesis used in the scope. Are my changes valid?

P.S. i need to apply the change on multiple places but that’s not a problem for me.

0 Likes

#2

The &amp is for specifying & (which is special in XML, I would imagine, hence needing to encode it).

The scope is saying that it needs to be text.html and also anything that’s not a tag or punctuation; your addition of and also not in markdown restricts that further.

0 Likes

#3

thank you very much @OdatNurd,

why is this ampersand needed in the scope? I think that someone has mentioned it before but i am unable to find any explanation on what it does here.

0 Likes

#4

It’s just a logical “and” operator. Required for selector to match only in HTML scope. AFAIK it’s required due to parenthesis following.

2 Likes