Open sghuang19 opened 2 months ago
@sghuang19 could you explain your use case a little more? PR #18 changed the default behavior to what it is currently.
If you want HTML comments, you can always use Emmet to do this (which is the workaround)
I set this with the keyboard shortcut option+ctrl+/
you could set it to ctrl+/
Hi @edheltzel, thanks for getting back!
html
files for me. Doesn't work in Markdown ( why ?)tags
in blog posts I wrote using Hexo
engine. It looks something like this:Markdown goes here.
<!-- comments here in texts should look like this -->
{# but actually they look like this #}
{% note primary no-icon %}
A callout here
{% endnote %}
Markdown goes here
So ideally when commenting outside of a tag
, HTML comment should be used.
More about my use cases:
I use Eleventy a lot, which is the whole reason this extension even exists – I'm not versed in Hexo, but I'll dig into it to make sure they aren't doing something that is missing or could add value.
As for the NJK comments verse, the HTML comments - Nunjucks will not render the comment in the final output. If that is not what you want, then HTML comments are the way to go by using Emmet. One of the main issues here is how Nunjucks doesn't have a different syntax for multiline comments... initially, Better Nunjucks used snippets to create NJK comments, but adding the support from PR #18 makes more sense going forward.
I do have it on my roadmap to include some VSCode setting options to enable this behavior by default or not, but don't hold your breath 😅
* Emmet toggle comment _only works in `html` files_ for me. Doesn't work in Markdown ( why ?)
Try adding this to your VSCode settings (also inside of the readme, closer to the bottom):
"emmet.includeLanguages": { "markdown": "html", "nunjucks": "html", }, "emmet.syntaxProfiles": { "markdown": "html", "nunjucks": "html", },
When the extension is installed, hitting Ctrl + / will use
{%%}
for comment everywhere in an.md
file. Ideally this should only happen inside a Nunjucks snippet.