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).
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With