draivin / hsnips

HyperSnips: a powerful snippet engine for VS Code, inspired by vim's UltiSnips
MIT License
148 stars 23 forks source link

Escape character not working for code blocks in markdown #178

Open qpdk777 opened 10 months ago

qpdk777 commented 10 months ago

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

````typescript
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.

Take-Me1010 commented 8 months ago

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.