hsnips icon indicating copy to clipboard operation
hsnips copied to clipboard

Escape character not working for code blocks in markdown

Open TreapGoGo opened this issue 1 year ago • 1 comments

At the beginning, I tried to write

snippet cpp "C++ code block" i
```cpp
$1
```
endsnippet

However, this whole extension broke down. I think it is the backquotes' fault.

Then I tried to write

snippet cpp "C++ code block" i
\`\`\`cpp
$1
\`\`\`
endsnippet

And here is the consequence after I press Tab:

image

It seems that backslash cannot play a role as escape character.

TreapGoGo avatar Aug 25 '23 19:08 TreapGoGo

I have same issue. After some trials, I found this below snippet works.

snippet cpp "C++ code block"
``rv = "\`\`\`cpp";``
$0
``rv = "\`\`\`";``
endsnippet

Obviously, this solution is not beautiful.

Take-Me1010 avatar Nov 07 '23 03:11 Take-Me1010