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.ts10
-rw-r--r--vhosts/blog/nuldoc-src/djot/to_html.ts7
2 files changed, 15 insertions, 2 deletions
diff --git a/vhosts/blog/nuldoc-src/djot/djot2ndoc.ts b/vhosts/blog/nuldoc-src/djot/djot2ndoc.ts
index fa0365b0..90b1289c 100644
--- a/vhosts/blog/nuldoc-src/djot/djot2ndoc.ts
+++ b/vhosts/blog/nuldoc-src/djot/djot2ndoc.ts
@@ -737,6 +737,16 @@ function processDiv(node: DjotDiv): Element {
};
}
+ if (node.attributes?.class === "edit") {
+ delete node.attributes.class;
+ return {
+ kind: "element",
+ name: "note",
+ attributes: convertAttributes(node.attributes),
+ children: node.children.map(processBlock),
+ };
+ }
+
return {
kind: "element",
name: "div",
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,
}],
};