mirror of
https://github.com/iaremarkus/wol-reference-viewer.git
synced 2026-07-22 06:14:20 +00:00
11 lines
437 B
TypeScript
11 lines
437 B
TypeScript
export interface ReferenceData {
|
|
type: 'reference';
|
|
ref: string; // the original query string
|
|
results: string[]; // HTML strings from each result
|
|
}
|
|
|
|
/** Safely append an HTML string to an element without using innerHTML. */
|
|
export function appendHTML(el: HTMLElement, html: string): void {
|
|
const doc = new DOMParser().parseFromString(html, 'text/html');
|
|
el.append(...Array.from(doc.body.childNodes));
|
|
}
|