aboutsummaryrefslogtreecommitdiffhomepage
path: root/nuldoc-src/docbook/to_html.ts
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2023-03-12 15:12:10 +0900
committernsfisis <nsfisis@gmail.com>2023-03-12 15:12:10 +0900
commitde13d68cddef5bb321469bcffb868f27ddd5390e (patch)
tree3183bb2bc8b2ad7d34b6953e6a248747239f0afa /nuldoc-src/docbook/to_html.ts
parent5b49e6bca39d7cd3b98db8b826dc597d9f758a26 (diff)
downloadblog.nsfisis.dev-de13d68cddef5bb321469bcffb868f27ddd5390e.tar.gz
blog.nsfisis.dev-de13d68cddef5bb321469bcffb868f27ddd5390e.tar.zst
blog.nsfisis.dev-de13d68cddef5bb321469bcffb868f27ddd5390e.zip
style: add .highlight class to pre tag
Diffstat (limited to 'nuldoc-src/docbook/to_html.ts')
-rw-r--r--nuldoc-src/docbook/to_html.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/nuldoc-src/docbook/to_html.ts b/nuldoc-src/docbook/to_html.ts
index 6788158..64d3492 100644
--- a/nuldoc-src/docbook/to_html.ts
+++ b/nuldoc-src/docbook/to_html.ts
@@ -192,6 +192,8 @@ function transformProgramListingElement(doc: Document) {
}
n.name = "pre";
+ const preClass = n.attributes.get("class");
+ n.attributes.set("class", preClass ? preClass + " highlight" : "highlight");
const codeElement: Element = {
kind: "element",
name: "code",
@@ -209,12 +211,13 @@ function transformLiteralLayoutElement(doc: Document) {
}
n.name = "pre";
- const children = n.children;
+ const preClass = n.attributes.get("class");
+ n.attributes.set("class", preClass ? preClass + " highlight" : "highlight");
const codeElement: Element = {
kind: "element",
name: "code",
attributes: new Map(),
- children: children,
+ children: n.children,
};
n.children = [codeElement];
});