Files
discourse/test/javascripts/helpers/html-helper.js.es6
Robin Ward 4fa580fbd1 Revert "Rename all test files from JS -> ES6"
This reverts commit 2abe85b8344de1102c1589a9ac9421a8b296f2b5.
2020-03-25 16:13:43 -04:00

6 lines
164 B
JavaScript

export function stringToHTML(string) {
const parser = new DOMParser();
const doc = parser.parseFromString(string, "text/html");
return doc.body.firstChild;
}