mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-10-23 16:13:37 +00:00
13 lines
328 B
TypeScript
13 lines
328 B
TypeScript
import type {Html} from "../../../common/html";
|
|
|
|
export function generateNodeFromHtml(html: Html): Element {
|
|
const wrapper = document.createElement("div");
|
|
wrapper.innerHTML = html.html;
|
|
|
|
if (wrapper.firstElementChild === null) {
|
|
throw new Error("No element found in HTML");
|
|
}
|
|
|
|
return wrapper.firstElementChild;
|
|
}
|