Skip to content

Commit

Permalink
Update toHtml.js
Browse files Browse the repository at this point in the history
Added attribution to `toHtml` method
  • Loading branch information
parent-tobias authored Dec 15, 2023
1 parent da7d7bc commit 976825d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/util/toHtml.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// adapted from https://davidwalsh.name/convert-html-stings-dom-nodes
const toHtml = (str)=>document.createRange()
.createContextualFragment(
str.trim()
).firstChild;

export default toHtml;
export default toHtml;

0 comments on commit 976825d

Please sign in to comment.