Open GitLiamuk opened 7 years ago
The "inner" </p>
is added by autoclose..
htmltagwrap hasn't seen an update in about a year. I doubt we'll see a fix for this. But I did some testing and came up with this solution that works:
VSCode can do htmltagwrap without the extension. Here's how:
There you go. The only difference is that you get to enter the desired tag instead of automatically getting a p-tag.
PS: I know this doesn't really contribute to a bugfix, but since there hasn't been any work on this extension in a while, and I really grew fond of its functionality (as did others), I felt comfortable sharing this workaround here in case anyone else misses the ease of adding tags to a selection.
PPS: I'm aware this kinda misuses the emmet wrap feature, but it still works. Definitely better than having to remove an auto-closed tag each time.
This bug is the result of a breaking change from the autoclose feature discussed in https://github.com/Microsoft/vscode/issues/2246#issuecomment-325475022. I'm looking into fixing this (and also on accepting the pull requests that have been sitting here for a while). Apologies for the neglect to this extension. I want to fix it up and deliver on the top requests. Thanks for your patience!
In the meantime, a workaround is using the setting
"html.autoClosingTags": false
which will prevent the duplicate tag.
I have also the same problem and think the following details will be useful:
<p></p>Lorem.</p>
</p><p>
Note: If I select more then 1 line the problem does not occur!
This issue was moved to bgashler1/vscode-htmltagwrap#1
VSCode version: 1.16.0 adds a html autoclose feature.
This feature causes this extension to wrap the selected text prematurely, resulting in faulty markup.