UNPKG

@fancyapps/ui

Version:

Robust JavaScript UI Component Library

1 lines 624 B
!/*! License details at fancyapps.com/license */function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).window=e.window||{})}(this,function(e){"use strict";e.stringToHtml=function(e){var t=new DOMParser().parseFromString(e,"text/html").body;if(t.childElementCount>1){for(var n=document.createElement("div");t.firstChild;)n.appendChild(t.firstChild);return n}let i=t.firstChild;if(i&&!(i instanceof HTMLElement)){var n=document.createElement("div");return n.appendChild(i),n}return i}});