From 6ec18685b45a9ffeb8d2bc623a979bae4367cee9 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Sat, 15 Jun 2024 02:04:12 +0900 Subject: [PATCH] Improve automark.ts code to handle more symbols --- src/ts/plugins/automark.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ts/plugins/automark.ts b/src/ts/plugins/automark.ts index 6fea365b..ce119d46 100644 --- a/src/ts/plugins/automark.ts +++ b/src/ts/plugins/automark.ts @@ -1,5 +1,7 @@ const excludesDat = ['<','>','{','}','[',']','(',')','-',':',';','…','—','–','_','*','+','/','\\','|','!','?','.',',',' '] +const symbols = ['<','>','{','}','[',']','(',')','-',':',';','…','—','–','_','*','+','/','\\','|','!','?','.',',',' ', '\n', '。', '、', '!', '?', ',', ';', ':', '(', ')', '【', '】', '「', '」', '『', '』', '“', '”', '‘', '’', '《', '》', '〈', '〉', '‹', '›', '«', '»', '‟', '„'] + const selfClosingTags = [ 'br','hr','img','input','meta','link','base','area','col','command','embed','keygen','param','source','track','wbr', //self closing tags defined by HTML5 @@ -123,6 +125,10 @@ export function risuFormater(dat:string){ //spaces for detection line = ' ' + line + ' ' + const isNotCharacter = (t:string) => { + return symbols.includes(t) + } + for(let j=0;j