Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emmet balance, updatetag failing due to invalid HTML parsing algorithm #99896

Closed
OliverJAsh opened this issue Jun 11, 2020 · 4 comments · Fixed by #112597
Closed

Emmet balance, updatetag failing due to invalid HTML parsing algorithm #99896

OliverJAsh opened this issue Jun 11, 2020 · 4 comments · Fixed by #112597
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug emmet Emmet related issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Milestone

Comments

@OliverJAsh
Copy link
Contributor

OliverJAsh commented Jun 11, 2020

  • VSCode Version: 1.46.0
  • OS Version: 10.15.5

Steps to Reproduce:

  1. Create a tsx file with this content:
    import React from 'react';
    
    // <f
    
    const MyComponent = () => <div className="foo">Hello, World</div>;
  2. Highlight the opening tag of div and run any one of these commands:
    • "Emmet: Split/Join Tag"
    • "Emmet: Update Tag"
    • "Emmet: Go to Matching Pair"

Expected: the command should work
Actual: the command does nothing

If we remove the comment that contains <f, it works.

Does this issue occur when all extensions are disabled?: Yes

@sandy081 sandy081 added emmet Emmet related issues and removed new release labels Jun 12, 2020
@OliverJAsh OliverJAsh changed the title Emmet "split/join tag" does not work if file contains some characters Emmet "split/join tag" and "update tag" do not work if file contains some characters Jul 8, 2020
@OliverJAsh
Copy link
Contributor Author

OliverJAsh commented Jul 8, 2020

Updated issue to mention that this also effects other commands.

@OliverJAsh OliverJAsh changed the title Emmet "split/join tag" and "update tag" do not work if file contains some characters Emmet tag commands do not work if file contains some characters Jul 8, 2020
@amagupta-collab
Copy link
Contributor

Interested in working on this, will be picking it up

@rzhao271 rzhao271 added the bug Issue identified by VS Code Team member as probable bug label Nov 3, 2020
@rzhao271 rzhao271 added this to the Backlog milestone Nov 4, 2020
@rzhao271
Copy link
Contributor

rzhao271 commented Nov 10, 2020

The current parser in util.ts is trying to parse f as its own tag, and so I think it needs to be updated. Another instance of this issue is #73415

@rzhao271 rzhao271 changed the title Emmet tag commands do not work if file contains some characters Emmet tag commands failing due to invalid HTML parsing algorithm Nov 17, 2020
@rzhao271 rzhao271 changed the title Emmet tag commands failing due to invalid HTML parsing algorithm Emmet balance, updatetag failing due to invalid HTML parsing algorithm Nov 17, 2020
@rzhao271 rzhao271 modified the milestones: Backlog, January 2021 Dec 14, 2020
@rzhao271
Copy link
Contributor

Verifier:

  1. Set up a new .tsx file with the contents
import React from 'react';

// <f

const MyComponent = () => <div className="foo">Hello, World</div>;
  1. Place cursor on the first div
  2. Emmet: Go to Matching Tag should cause the cursor to go to the other div tag.
  3. Emmet: Update Tag should bring up a prompt for the new tag name. Enter span. The div tag should have changed to a span tag. The className="foo" part and the inner contents should remain the same.
  4. Emmet: Split/Join Tag should collapse the <div className="foo">...</div> into <div className="foo"/>, and then <div className="foo"></div>.

@meganrogge meganrogge added the verified Verification succeeded label Jan 26, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug emmet Emmet related issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@OliverJAsh @rzhao271 @sandy081 @meganrogge @amagupta-collab and others