Giter Site home page Giter Site logo

Comments (6)

bgashler1 avatar bgashler1 commented on August 24, 2024

From @dimkir on September 12, 2017 11:38

The "inner" </p> is added by autoclose..
image

from vscode-htmltagwrap.

bgashler1 avatar bgashler1 commented on August 24, 2024

From @bennyschaefer on September 22, 2017 11:8

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:

  1. Disable or remove the htmltagwrap extension
  2. File > Preferences > Keyboard Shortcuts
  3. Search for 'emmet wrap'
  4. Set Keybinding for 'Wrap Individual Lines with Abbreviation' to Alt + W (or whatever you desire)

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.

from vscode-htmltagwrap.

bgashler1 avatar bgashler1 commented on August 24, 2024

This bug is the result of a breaking change from the autoclose feature discussed in microsoft/vscode#2246 (comment). 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!

from vscode-htmltagwrap.

bgashler1 avatar bgashler1 commented on August 24, 2024

In the meantime, a workaround is using the setting

    "html.autoClosingTags": false

which will prevent the duplicate tag.

from vscode-htmltagwrap.

bgashler1 avatar bgashler1 commented on August 24, 2024

From @dreadsoul on October 3, 2017 13:13

I have also the same problem and think the following details will be useful:
1. if I do select a word then i get: <p></p>Lorem.</p>
2. if i do just Alt+W i have: </p><p>

Note: If I select more then 1 line the problem does not occur!

from vscode-htmltagwrap.

bgashler1 avatar bgashler1 commented on August 24, 2024

@GitLiamuk this should be fixed now. It was an issue with an emmet feature that was enabled by default in a recent VS Code release. I've updated the way htmltagwrap does its thing so that it doesn't trigger emmet to do duplicate work.

from vscode-htmltagwrap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.