summaryrefslogtreecommitdiffhomepage
path: root/vhosts/blog/nuldoc-src/renderers/html.ts
diff options
context:
space:
mode:
Diffstat (limited to 'vhosts/blog/nuldoc-src/renderers/html.ts')
-rw-r--r--vhosts/blog/nuldoc-src/renderers/html.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/vhosts/blog/nuldoc-src/renderers/html.ts b/vhosts/blog/nuldoc-src/renderers/html.ts
index ec77eb4d..b9336b53 100644
--- a/vhosts/blog/nuldoc-src/renderers/html.ts
+++ b/vhosts/blog/nuldoc-src/renderers/html.ts
@@ -183,9 +183,14 @@ function elementNodeToHtmlText(e: Element, ctx: Context): string {
s += " ";
for (let i = 0; i < attributes.length; i++) {
const [name, value] = attributes[i];
- s += `${name === "className" ? "class" : name}="${
- encodeSpecialCharacters(value)
- }"`;
+ if (name === "defer" && value === "true") {
+ // TODO
+ s += "defer";
+ } else {
+ s += `${name === "className" ? "class" : name}="${
+ encodeSpecialCharacters(value)
+ }"`;
+ }
if (i !== attributes.length - 1) {
s += " ";
}
@@ -246,6 +251,7 @@ function indent(ctx: Context): string {
function getElementAttributes(e: Element): [string, string][] {
return [...e.attributes.entries()]
.filter((a) => !a[0].startsWith("--"))
+ .filter((a) => a[1] !== undefined)
.sort(
(a, b) => {
// Special rules: