aboutsummaryrefslogtreecommitdiffhomepage
path: root/nuldoc-src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2023-03-18 19:51:06 +0900
committernsfisis <nsfisis@gmail.com>2023-03-18 19:51:06 +0900
commit7f15e0b8277ac8b101b4f71ce57c1c5442927141 (patch)
tree31d54a18ede023adeb23a984c907860d667288bd /nuldoc-src
parent032dc3c5e6d0ef84a9f4ea6be10e19b7f43c53b8 (diff)
downloadblog.nsfisis.dev-7f15e0b8277ac8b101b4f71ce57c1c5442927141.tar.gz
blog.nsfisis.dev-7f15e0b8277ac8b101b4f71ce57c1c5442927141.tar.zst
blog.nsfisis.dev-7f15e0b8277ac8b101b4f71ce57c1c5442927141.zip
fix(nuldoc): fix whitespaces being trimmed
Diffstat (limited to 'nuldoc-src')
-rw-r--r--nuldoc-src/pages/post_list.ts2
-rw-r--r--nuldoc-src/pages/tag.ts2
-rw-r--r--nuldoc-src/renderers/html.ts4
3 files changed, 3 insertions, 5 deletions
diff --git a/nuldoc-src/pages/post_list.ts b/nuldoc-src/pages/post_list.ts
index 09d1942..5b511b0 100644
--- a/nuldoc-src/pages/post_list.ts
+++ b/nuldoc-src/pages/post_list.ts
@@ -56,7 +56,7 @@ export async function generatePostListPage(
el(
"footer",
[["class", "entry-footer"]],
- text("Posted on"),
+ text("Posted on "),
el(
"time",
[["datetime", getPostCreatedDate(post)]],
diff --git a/nuldoc-src/pages/tag.ts b/nuldoc-src/pages/tag.ts
index b6f136a..a7ffbb2 100644
--- a/nuldoc-src/pages/tag.ts
+++ b/nuldoc-src/pages/tag.ts
@@ -48,7 +48,7 @@ export async function generateTagPage(
el(
"footer",
[["class", "entry-footer"]],
- text("Posted on"),
+ text("Posted on "),
el(
"time",
[["datetime", getPostCreatedDate(post)]],
diff --git a/nuldoc-src/renderers/html.ts b/nuldoc-src/renderers/html.ts
index 3c49174..94d134b 100644
--- a/nuldoc-src/renderers/html.ts
+++ b/nuldoc-src/renderers/html.ts
@@ -125,9 +125,7 @@ function textNodeToHtmlText(t: Text, ctx: Context): string {
if (ctx.isInPre) return s;
// TODO: 日本語で改行するときはスペースを入れない
- return s
- .trim()
- .replaceAll(/\n */g, " ");
+ return s.replaceAll(/\n */g, " ");
}
function encodeSpecialCharacters(s: string): string {