discourse/test/javascripts/helpers/html-helper.js

Failed to ignore revisions in .git-blame-ignore-revs.

6 lines
164 B
JavaScript
Raw Normal View History

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