summaryrefslogtreecommitdiffhomepage
path: root/vhosts/blog/nuldoc-src
diff options
context:
space:
mode:
Diffstat (limited to 'vhosts/blog/nuldoc-src')
-rw-r--r--vhosts/blog/nuldoc-src/djot/djot2ndoc.ts3
-rw-r--r--vhosts/blog/nuldoc-src/djot/to_html.ts5
2 files changed, 8 insertions, 0 deletions
diff --git a/vhosts/blog/nuldoc-src/djot/djot2ndoc.ts b/vhosts/blog/nuldoc-src/djot/djot2ndoc.ts
index 55b63a0d..fa0365b0 100644
--- a/vhosts/blog/nuldoc-src/djot/djot2ndoc.ts
+++ b/vhosts/blog/nuldoc-src/djot/djot2ndoc.ts
@@ -133,6 +133,9 @@ function processCodeBlock(node: DjotCodeBlock): Element {
if (node.attributes?.filename) {
attributes.set("filename", node.attributes.filename);
}
+ if (node.attributes?.numbered) {
+ attributes.set("numbered", "true");
+ }
return {
kind: "element",
name: "codeblock",
diff --git a/vhosts/blog/nuldoc-src/djot/to_html.ts b/vhosts/blog/nuldoc-src/djot/to_html.ts
index b64c3d99..e2d6a9b6 100644
--- a/vhosts/blog/nuldoc-src/djot/to_html.ts
+++ b/vhosts/blog/nuldoc-src/djot/to_html.ts
@@ -367,6 +367,7 @@ async function transformAndHighlightCodeBlockElement(doc: Document) {
const language = n.attributes.get("language") || "text";
const filename = n.attributes.get("filename");
+ const numbered = n.attributes.get("numbered");
const sourceCodeNode = n.children[0] as Text | RawHTML;
const sourceCode = sourceCodeNode.content.trimEnd();
@@ -382,6 +383,10 @@ async function transformAndHighlightCodeBlockElement(doc: Document) {
n.attributes.set("class", "codeblock");
n.attributes.delete("language");
+ if (numbered === "true") {
+ n.attributes.delete("numbered");
+ addClass(n, "numbered");
+ }
if (filename) {
n.attributes.delete("filename");