From 2b50e1778b164e641c03c2e77176b6f47ca1e278 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 18 Mar 2023 15:47:05 +0900 Subject: refactor: add RawHTML type to represent text node not being escaped --- nuldoc-src/dom.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'nuldoc-src/dom.ts') diff --git a/nuldoc-src/dom.ts b/nuldoc-src/dom.ts index 51ef25a..626d400 100644 --- a/nuldoc-src/dom.ts +++ b/nuldoc-src/dom.ts @@ -1,6 +1,13 @@ export type Text = { kind: "text"; content: string; + raw: false; +}; + +export type RawHTML = { + kind: "text"; + content: string; + raw: true; }; export type Element = { @@ -10,7 +17,7 @@ export type Element = { children: Node[]; }; -export type Node = Element | Text; +export type Node = Element | Text | RawHTML; export function addClass(e: Element, klass: string) { const classes = e.attributes.get("class"); -- cgit v1.2.3-70-g09d2