summaryrefslogtreecommitdiffhomepage
path: root/services/blog/nuldoc-src/djot
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-07-20 03:14:42 +0900
committernsfisis <nsfisis@gmail.com>2025-07-20 03:14:42 +0900
commit1f1870a1852558166cabfdfdcc4bc1437e37a45a (patch)
tree163ce5c5a7c6147c2f566b25e40dcadb9b210945 /services/blog/nuldoc-src/djot
parent037da3c3c4cf7d4e62cb5248ecccfe75d88f684b (diff)
downloadnsfisis.dev-1f1870a1852558166cabfdfdcc4bc1437e37a45a.tar.gz
nsfisis.dev-1f1870a1852558166cabfdfdcc4bc1437e37a45a.tar.zst
nsfisis.dev-1f1870a1852558166cabfdfdcc4bc1437e37a45a.zip
feat(blog/style): fix word-break style of links
Diffstat (limited to 'services/blog/nuldoc-src/djot')
-rw-r--r--services/blog/nuldoc-src/djot/djot2ndoc.ts6
-rw-r--r--services/blog/nuldoc-src/djot/to_html.ts2
2 files changed, 5 insertions, 3 deletions
diff --git a/services/blog/nuldoc-src/djot/djot2ndoc.ts b/services/blog/nuldoc-src/djot/djot2ndoc.ts
index 2abb6ce3..627e8d63 100644
--- a/services/blog/nuldoc-src/djot/djot2ndoc.ts
+++ b/services/blog/nuldoc-src/djot/djot2ndoc.ts
@@ -46,7 +46,7 @@ import {
Url as DjotUrl,
Verbatim as DjotVerbatim,
} from "@djot/djot";
-import { elem, Element, Node, rawHTML, text } from "../dom.ts";
+import { addClass, elem, Element, Node, rawHTML, text } from "../dom.ts";
function processBlock(node: DjotBlock): Element {
switch (node.tag) {
@@ -419,7 +419,7 @@ function processFootnoteReference(node: DjotFootnoteReference): Element {
}
function processUrl(node: DjotUrl): Element {
- return elem(
+ const e = elem(
"a",
{
href: node.text,
@@ -427,6 +427,8 @@ function processUrl(node: DjotUrl): Element {
},
text(node.text),
);
+ addClass(e, "url");
+ return e;
}
function processSpan(node: DjotSpan): Element {
diff --git a/services/blog/nuldoc-src/djot/to_html.ts b/services/blog/nuldoc-src/djot/to_html.ts
index c4939d5b..8219b747 100644
--- a/services/blog/nuldoc-src/djot/to_html.ts
+++ b/services/blog/nuldoc-src/djot/to_html.ts
@@ -115,7 +115,7 @@ function transformLinkLikeToAnchorElement(doc: Document) {
}
const [_, prefix, url, suffix] = match;
nodes.push(text(prefix));
- nodes.push(elem("a", { href: url }, text(url)));
+ nodes.push(elem("a", { href: url, class: "url" }, text(url)));
restContent = suffix;
}
return nodes;