We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 504e342 commit 5f0f6ecCopy full SHA for 5f0f6ec
src/core/dom.js
@@ -131,8 +131,14 @@ const is_visible = (el) => {
131
return el.offsetWidth > 0 && el.offsetHeight > 0;
132
};
133
134
+/**
135
+ * Return a DocumentFragment from a given string.
136
+ *
137
+ * @param {String} string - The HTML structure as a string.
138
139
+ * @returns {DocumentFragment} - The DOM nodes as a DocumentFragment.
140
+ */
141
const create_from_string = (string) => {
- // Create a DOM nodes from a string.
142
// See: https://davidwalsh.name/convert-html-stings-dom-nodes
143
return document.createRange().createContextualFragment(string.trim());
144
0 commit comments