mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 13:16:43 +08:00
119c4d0c1b
This will replace the need for jquery: `$(string)`
6 lines
164 B
JavaScript
6 lines
164 B
JavaScript
export function stringToHTML(string) {
|
|
const parser = new DOMParser();
|
|
const doc = parser.parseFromString(string, "text/html");
|
|
return doc.body.firstChild;
|
|
}
|