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

.html() fails if argument contains a comment with embedded start tag #4124

Closed
bosma4u opened this issue Jul 11, 2018 · 1 comment
Closed

.html() fails if argument contains a comment with embedded start tag #4124

bosma4u opened this issue Jul 11, 2018 · 1 comment
Assignees
Milestone

Comments

@bosma4u
Copy link

@bosma4u bosma4u commented Jul 11, 2018

Description

Calling html() with an argument containing a html comment fails if the comment has a start tag embedded somewhere.
I don't care about the comment itself, but the non comment part of the argument should be processed.
This bug occurs at least in FireFox, Edge and Chrome (I suspect other browsers as well), in 3.x versions of jquery, not before.
A work-around is to embed the argument in a div.

Link to test case

https://jsfiddle.net/bosma4u/xpvt214o/397622/

@gibson042
Copy link
Member

@gibson042 gibson042 commented Jul 11, 2018

It's generally a bad idea to supply input that is not well-formed (i.e., you are missing end tags for your <p> elements). However, in this case there really is a bug with our element detection logic. Fix coming shortly.

@gibson042 gibson042 self-assigned this Jul 11, 2018
@gibson042 gibson042 added this to the 3.4.0 milestone Jul 11, 2018
gibson042 added a commit that referenced this issue Jul 13, 2018
Fixes gh-4124
Closes gh-4125
@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants