mirror of
https://github.com/koishijs/novelai-bot
synced 2025-01-07 07:06:54 +08:00
fix: fix CJS word checking, fix #179
This commit is contained in:
parent
f1179b999b
commit
e32eb9a8ee
@ -361,7 +361,7 @@ export function parseForbidden(input: string) {
|
||||
.map<Forbidden>((pattern: string) => {
|
||||
const strict = pattern.endsWith('!')
|
||||
if (strict) pattern = pattern.slice(0, -1)
|
||||
pattern = pattern.replace(/[^a-z0-9]+/g, ' ').trim()
|
||||
pattern = pattern.replace(/[^a-z0-9\u00ff-\uffff]+/g, ' ').trim()
|
||||
return { pattern, strict }
|
||||
})
|
||||
}
|
||||
@ -431,7 +431,7 @@ export function parseInput(session: Session, input: string, config: Config, over
|
||||
}
|
||||
return true
|
||||
}).map((word) => {
|
||||
if (/^<.+>$/.test(word)) return word
|
||||
if (/^<.+>$/.test(word)) return word.replace(/ /g, '_')
|
||||
return word.toLowerCase()
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user