Fenced code blocks fail if there is a tilde (or backtick) in the attributes of a fenced codeblock.
For example, the following markdown highlights as expected.
```sh {higlight="content:/$foo"}
cd ~/$foo
```
But as soon as you add a tilde to the filepath, syntax highlighting stops working:
```sh {higlight="content:~/$foo"}
cd ~/$foo
```
This works with github, for example:
cd ~/$foo
But in VS Code, the opening of the code block is not recognised, which results in the closing of the code block being recognised as an opening which breaks highlighting for the remainder of the file.
I have tried to find why backticks and tildes are excluded here, but they date back to the initial commit, so I am not fully sure of the reasoning for excluding them. Other than perhaps to avoid matching something like ~~~foo~~~ which should be matched by a different rule? In which case perhaps we could instead block on 3 or more?
Fenced code blocks fail if there is a tilde (or backtick) in the attributes of a fenced codeblock.
For example, the following markdown highlights as expected.
But as soon as you add a tilde to the filepath, syntax highlighting stops working:
This works with github, for example:
But in VS Code, the opening of the code block is not recognised, which results in the closing of the code block being recognised as an opening which breaks highlighting for the remainder of the file.
I have tried to find why backticks and tildes are excluded here, but they date back to the initial commit, so I am not fully sure of the reasoning for excluding them. Other than perhaps to avoid matching something like
~~~foo~~~
which should be matched by a different rule? In which case perhaps we could instead block on 3 or more?