Open stdedos opened 5 years ago
Uncommenting in HTML still doesn't work. Example:
<!-- <a class="active tab" data-tab="inventory">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"></path></svg>
Inventory
</a> -->
Uncommenting on the bottom line produces: <!-- </a> --> -->
and leaves the rest unchanged.
Uncommenting on the second to bottom line produces:
<!-- <a class="active tab" data-tab="inventory">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"></path></svg>
<!-- Inventory -->
</a> -->
Uncommenting on the second line produces:
<!-- <a class="active tab" data-tab="inventory">
<!-- <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"></path></svg> -->
Inventory
</a> -->
Uncommenting the top line produces:
<!-- <!-- <a class="active tab" data-tab="inventory"> -->
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"></path></svg>
Inventory
</a> -->
All four of these results are invalid...
A lot of fixing internet knowledge here: https://stackoverflow.com/questions/1324821/nested-comments-in-xml
This is what it looks like in ST 4098.
I need to select the whole <a>
tag to comment it, but uncommenting works correctly wherever the caret is located.
@deathaxe your test is missing the pre-existing comment on said line
(I amended the issue title to reflect that)
Thank you @deathaxe for making the gif, and thanks both for looking into this.
It's probably something about handling inline SVGs in HTML would be my guess.
Which pre-existing comment is missing on which said line? The comment starts with the whole <a ... </a>
commented out, which is what I did, too. Than commenting it in with the caret located at different lines, which is said to not work, but actually does with ST 4098. What do I miss?
Once the whole block is commented in, triggereing "comment line" comments out the current line (only), if nothing is selected. How should it know how many lines to comment out otherwise?
Anyway, the issue described by @justingolden21 is different from the inititial issue comment, which is about commenting out lines which contain comments.
The only solution I'd see is to comment out text before the first punctuation.comment.begin
only.
<test>foobar</test><!-- Comment -->
becomes
<!--<test>foobar</test>--><!-- Comment -->
Summary
Expected behavior
Ctrl+/
):Ctrl+/
) to "revert" L2:<test>foobar</test>
, Press Comment (Ctrl+/
) twice:Actual behavior
I understand that the nature of XML comments makes this process tricky; so fix it however it feels better
Environment