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

Handle the case of an empty string. Fixes #13401. #1163

Closed
wants to merge 2 commits into from
Closed

Handle the case of an empty string. Fixes #13401. #1163

wants to merge 2 commits into from

Conversation

markraddatz
Copy link
Contributor

Adds a value === "" check to .replaceWith().

jQuery( this ).remove();
});
}

return this.domManip( [ value ], true, function( elem ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not:

return value === "" ?
    this.remove() :
    this.domManip(…);

?

@gibson042
Copy link
Member

All true, @dmethvin. .domManip does some weird input handling, casting true to text but ignoring false (shades of #10867? 😈), and .replaceWith is the black sheep of manipulation methods. I'd like to fix both in 1.11/2.1.

@gibson042 gibson042 closed this in 6a0ee2d Feb 8, 2013
@gibson042
Copy link
Member

Thanks @markraddatz; I made some minor tweaks for style and compression but the fix is all yours!

gibson042 pushed a commit that referenced this pull request Feb 8, 2013
mescoda pushed a commit to mescoda/jquery that referenced this pull request Nov 4, 2014
@lock lock bot locked as resolved and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants