Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tilde in markdown doc in Sublime3 causes next blank line to be red

Tags:

sublimetext3

If you open a new blank file in Sublime 3, type a line with a tilde, and follow it by a blank line, then go to View|Syntax and select Markdown, the blank line will be highlighted in red as shown below. Is this a bug or is one not supposed to use tildes in Markdown (do they have some special meaning?). This also happens for Rmarkdown docs (they knit to PDFs just fine, btw, with unescaped tildes).

enter image description here

like image 930
Ben S. Avatar asked Dec 06 '18 16:12

Ben S.


1 Answers

The markdown syntax that ships with Sublime uses GFM (GitHub Flavoured Markdown), and in that spec the ~ character can be used for both code blocks as well as strike through text.

So in this case the reason for the red highlight is that the syntax thinks you've forgotten to close the strike through region.

You can resolve the issue by quoting the tilde, such as I have about \~10 donuts., which will mark the \~ as a markdown escape character and tell the syntax what you intended.

like image 178
OdatNurd Avatar answered Sep 18 '22 08:09

OdatNurd