develop #36
@@ -83,7 +83,7 @@ const deduplicateSidInput = (value: string) => [...new Set(toSidSet(value))].joi
|
|||||||
|
|
||||||
const sanitizeSidInput = (value: string) => {
|
const sanitizeSidInput = (value: string) => {
|
||||||
let result = ''
|
let result = ''
|
||||||
let lastChar: 'digit' | 'comma' | 'tilde' | null = null
|
let lastChar: 'digit' | 'char' | 'comma' | 'tilde' | null = null
|
||||||
let segmentHasTilde = false
|
let segmentHasTilde = false
|
||||||
|
|
||||||
for (const ch of value) {
|
for (const ch of value) {
|
||||||
@@ -93,7 +93,15 @@ const sanitizeSidInput = (value: string) => {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ch === ',' && lastChar === 'digit') {
|
if (/[a-zA-Z_-]/.test(ch)) {
|
||||||
|
// 틸드 범위 검색은 숫자끼리만 허용되므로, 틸드 바로 뒤에는 문자를 붙이지 않는다.
|
||||||
|
if (lastChar === 'tilde') continue
|
||||||
|
result += ch
|
||||||
|
lastChar = 'char'
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ch === ',' && (lastChar === 'digit' || lastChar === 'char')) {
|
||||||
result += ch
|
result += ch
|
||||||
lastChar = 'comma'
|
lastChar = 'comma'
|
||||||
segmentHasTilde = false
|
segmentHasTilde = false
|
||||||
|
|||||||
Reference in New Issue
Block a user