From 87a9bab656cd43e1c31d18d3eac33f465420285f Mon Sep 17 00:00:00 2001 From: Oling Cat Date: Sun, 23 Jun 2024 04:43:31 +0800 Subject: [PATCH] Update space match rule --- functional-programming-lean/custom.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functional-programming-lean/custom.js b/functional-programming-lean/custom.js index 2f5ff10..80f4100 100644 --- a/functional-programming-lean/custom.js +++ b/functional-programming-lean/custom.js @@ -1,5 +1,5 @@ -const newline = /(?<=[,。、:」)])\n(?!\n)/g; -const space = /\s+(<.+?>\p{Script=Han}.+?<\/.+?>)\s+/g +const newline = /(?<=[,。、:;」)])\n(?!\n)/gu; +const space = /\s*(<.+?>\p{Script=Han}.+?<\/.+?>)\s*/gu; const paras = document.querySelectorAll("#content > main > p"); for (const p of paras) { p.innerHTML = p.innerHTML.replace(newline, "");