keep comma

main
Haoming 2025-02-19 14:25:01 +08:00
parent 35f84b8698
commit 5a2f24ec42
1 changed files with 4 additions and 0 deletions

View File

@ -240,6 +240,9 @@ onUiLoaded(() => {
event.preventDefault();
const commaStart = paste.match(/^\s*\,/);
const commaEnd = paste.match(/\,\s*$/);
if (config.booru) {
paste = paste.replace(/\s[\d.]{2,}[kM]?|[\?\+\-]\s+/g, ", ");
for (const excl of ["Artist", "Characters", "Character", "Copyright", "Tags", "Tag", "General"])
@ -252,6 +255,7 @@ onUiLoaded(() => {
}
paste = LeFormatter.formatString(paste, config.dedupe, config.removeUnderscore);
paste = `${commaStart ? ", " : ""}${paste}${commaEnd ? ", " : ""}`
const currentText = field.value;
const cursorPosition = field.selectionStart;