-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Support for insertAdjacentHTML
#1219
Comments
Yes, I was planning to add this eventually |
+1. Fresh jquery convert here: is there another way that I can use in the meantime? |
You can just use |
Oh, cool. Thanks! Seems |
Here is how you can avoid a reparse. This would be similar to how function htmlToFragment(ownerDocument, markup) {
const container = ownerDocument.createElement('div');
container.innerHTML = markup;
const fragment = ownerDocument.createDocumentFragment();
while (container.firstChild) {
fragment.appendChild(container.firstChild);
}
return fragment;
} (might contain typo's) Then you can do something like: |
insertAdjacent
insertAdjacentHTML
Yeah, that will generally work, although it doesn't work for e.g. inserting |
+1. Trying out jsdom for the first time today and came across this limitation. |
You can write your own with something like |
@domenic It will work even for |
Is there plans to support
element.insertAdjacent
in jsdom?Results in:
The text was updated successfully, but these errors were encountered: