diff options
Diffstat (limited to 'nuldoc-src/docbook')
| -rw-r--r-- | nuldoc-src/docbook/to_html.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/nuldoc-src/docbook/to_html.ts b/nuldoc-src/docbook/to_html.ts index 0672ea6..7c21036 100644 --- a/nuldoc-src/docbook/to_html.ts +++ b/nuldoc-src/docbook/to_html.ts @@ -2,6 +2,7 @@ import hljs from "hljs/highlight.min.js"; import { Document } from "./document.ts"; import { DocBookError } from "../errors.ts"; import { + addClass, Element, findFirstChildElement, forEachChild, @@ -195,8 +196,7 @@ function transformProgramListingElement(doc: Document) { } n.name = "pre"; - const preClass = n.attributes.get("class"); - n.attributes.set("class", preClass ? preClass + " highlight" : "highlight"); + addClass(n, "highlight"); const codeElement: Element = { kind: "element", name: "code", @@ -214,8 +214,7 @@ function transformLiteralLayoutElement(doc: Document) { } n.name = "pre"; - const preClass = n.attributes.get("class"); - n.attributes.set("class", preClass ? preClass + " highlight" : "highlight"); + addClass(n, "highlight"); const codeElement: Element = { kind: "element", name: "code", |
