From 7f15e0b8277ac8b101b4f71ce57c1c5442927141 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 18 Mar 2023 19:51:06 +0900 Subject: fix(nuldoc): fix whitespaces being trimmed --- nuldoc-src/pages/post_list.ts | 2 +- nuldoc-src/pages/tag.ts | 2 +- nuldoc-src/renderers/html.ts | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) (limited to 'nuldoc-src') 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 { -- cgit v1.2.3-70-g09d2