summaryrefslogtreecommitdiffhomepage
path: root/vhosts/blog/nuldoc-src/djot/to_html.ts
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-06-15 12:54:00 +0900
committernsfisis <nsfisis@gmail.com>2025-06-15 12:57:11 +0900
commitc2252e60d3ab192271e4241943dd165087567af8 (patch)
treed40c4b528c4f74b02af056ab667bf8a6d7e42544 /vhosts/blog/nuldoc-src/djot/to_html.ts
parent796995ca280f554a25b24d3e03a028a5a479d9f2 (diff)
downloadnsfisis.dev-c2252e60d3ab192271e4241943dd165087567af8.tar.gz
nsfisis.dev-c2252e60d3ab192271e4241943dd165087567af8.tar.zst
nsfisis.dev-c2252e60d3ab192271e4241943dd165087567af8.zip
feat(blog/nuldoc): add custom div block for edit
Diffstat (limited to 'vhosts/blog/nuldoc-src/djot/to_html.ts')
-rw-r--r--vhosts/blog/nuldoc-src/djot/to_html.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/vhosts/blog/nuldoc-src/djot/to_html.ts b/vhosts/blog/nuldoc-src/djot/to_html.ts
index c765cb07..3a6c1e9f 100644
--- a/vhosts/blog/nuldoc-src/djot/to_html.ts
+++ b/vhosts/blog/nuldoc-src/djot/to_html.ts
@@ -199,14 +199,17 @@ function transformNoteElement(doc: Document) {
return;
}
- // TODO: 今のセクションレベルに合わせた h* タグにしたい
+ const editatAttr = n.attributes?.get("editat");
+ const operationAttr = n.attributes?.get("operation");
+ const isEditBlock = editatAttr && operationAttr;
+
const labelElement: Element = {
kind: "element",
name: "div",
attributes: new Map([["class", "admonition-label"]]),
children: [{
kind: "text",
- content: "NOTE",
+ content: isEditBlock ? `${editatAttr} ${operationAttr}` : "NOTE",
raw: false,
}],
};