[feat] added risuidentify

This commit is contained in:
kwaroran
2023-07-27 11:02:05 +09:00
parent 77289f7a47
commit c96491d353
3 changed files with 16 additions and 6 deletions

View File

@@ -4,17 +4,14 @@ const reg:[RegExp,string][] = []
export function autoMarkPlugin(data:string){
if(reg.length === 0){
const pluginRegex = [
{"comment":"──── ▼ Head 스크립트 ▼ ───────────────────────────────────────────────","in":"","out":"","type":"editinput","ableFlag":false,"flag":"g"},
{"comment":"[ 💱 ]ㅤ구조변환 #1=ㅤ대사 부호 수정","in":"“|”","out":"\"","type":"editdisplay","ableFlag":false},
{"comment":"[ 💱 ]ㅤ구조변환 #2=ㅤ생각 부호 수정","in":"|","out":"'","type":"editdisplay","ableFlag":false},
{"comment":"──── ▼ Auto 스크립트 ▼ ───────────────────────────────────────────────","in":"","out":"","type":"editinput","ableFlag":false,"flag":"g"},
{"comment":"[ 🧷 ]ㅤ이탈릭체 #1=ㅤ문장 앞 묶음 추가","in":"^(?!\\d\\.)([\\wㄱ-ㅎ가-힣'])(?!.*[{<>}])|(?<=^\\[.*\\] *|^\\(.*\\) *)([\\wㄱ-ㅎ가-힣'])(?!.*[{<>}])","out":"<em>$1$2","type":"editdisplay","ableFlag":true,"flag":"gm"},
{"comment":"[ 🧷 ]ㅤ이탈릭체 #2=ㅤ문장 뒤 묶음 추가","in":"(?<!^ +.*)(\".*|<em>.*)(?<!\")$","out":"$1</em>","type":"editdisplay","ableFlag":true,"flag":"gm"},
{"comment":"[ 🧷 ]ㅤ대사묶음 #1=ㅤ대사 앞 묶음 추가","in":"(?<=<em>.*|^\".*)( +\"[\\S])|(?<=<em>.*|\" +.*)( *\\[)","out":"</em>$1$2","type":"editdisplay","ableFlag":true,"flag":"gm"},
{"comment":"[ 🧷 ]ㅤ대사묶음 #2=ㅤ대사 뒤 묶음 추가","in":"(?<=^\".*|<\\/em>.*)([\\S]\" +|[\\S]\"(?=[,.…ㄱ-ㅎ가-힣]))|(?<=<\\/em>.*)( *\\] *)","out":"$1$2<em>","type":"editdisplay","ableFlag":true,"flag":"gm"},
{"comment":"[ 🧷 ]ㅤ생각묶음 #1=ㅤ생각 앞 묶음 추가","in":"(?<=<em>.*? +|\\[|\\[.* +|\\(|\\(.* +|\"|\".*? +)(?<!style=.*)(')|(?<=<em>)('[\\wㄱ-ㅎ가-힣])","out":"<strong><em>$1$2","type":"editdisplay","ableFlag":true,"flag":"gm"},
{"comment":"[ 🧷 ]ㅤ생각묶음 #2=ㅤ생각 뒤 묶음 추가","in":"(?<=<strong><em>')(.*?')(?= +.+?|[ㄱ-ㅎ가-힣?!:;,.…—-])|(?<=<strong><em>'.*)(')(?=<\\/em>|\")|(?<=\\(<strong><em>')(?=\\))","out":"$1$2</em></strong>","type":"editdisplay","ableFlag":true,"flag":"gm"},
{"comment":"──── ▼ Key 스크립트 ▼ ────────────────────────────────────────────────","in":"","out":"","type":"editinput","ableFlag":false},
{"comment":"[ 📝 ]ㅤ추가핫키 #1=ㅤ따옴표 추가 : (`)","in":"(?<!`)`(?!`)","out":"\"","type":"editinput","ableFlag":false},
{"comment":"[ 📝 ]ㅤ추가핫키 #2=OOC 추가 : (``)","in":"^``(?!`) *(.*)$","out":"(OOC: $1)","type":"editinput","ableFlag":true,"flag":"gm"}
]
@@ -25,5 +22,8 @@ export function autoMarkPlugin(data:string){
for(let i=0;i<reg.length;i++){
data = data.replace(reg[i][0], reg[i][1])
}
return data
}