Repository navigation
Allow Chinese tags and document categories #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1580,7 +1580,7 @@ async function addCategoryTag(tag: string): Promise<void> { | |
| if (!window.categoryTags) window.categoryTags = []; | ||
| if (!window.categoryAclChoices) window.categoryAclChoices = {}; | ||
|
|
||
| if (!/^[가-힣a-zA-Z0-9\s_.-]+$/.test(cleanTag)) { | ||
| if (!/^[\p{Script=Han}가-힣a-zA-Z0-9\s_.-]+$/u.test(cleanTag)) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When an application consumes the public Useful? React with 👍 / 👎. |
||
| window.Swal?.fire({ | ||
| icon: 'warning', | ||
| title: ui("m_63d43c7f9b539745"), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,11 +5,11 @@ | |
| */ | ||
|
|
||
| /** | ||
| * 태그 문자열 규칙: 카테고리와 동일 (한글/영숫자/공백/_/./-). | ||
| * 태그 문자열 규칙: 중국어/한글/영숫자/공백/_/./-. | ||
| * 최대 20개, 각 50자 이내. trim, 중복 제거, 정규식 통과 항목만 유효. | ||
| * 입력은 배열 / JSON 배열 문자열 / 쉼표구분 문자열을 모두 허용한다. | ||
| */ | ||
| const TAG_VALID_RE = /^[가-힣a-zA-Z0-9 _.-]+$/; | ||
| const TAG_VALID_RE = /^[\p{Script=Han}가-힣a-zA-Z0-9 _.-]+$/u; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a media tag contains newly accepted supplementary Han characters such as Useful? React with 👍 / 👎. |
||
| const TAG_MAX_COUNT = 20; | ||
| const TAG_MAX_LENGTH = 50; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For an accepted tag whose next character after the current query is supplementary Han, such as tag
中𠀀with query中, the autocomplete endpoint's upper bound${q}\uffffinsrc/routes/media.ts:308-310excludes it under SQLite's binary UTF-8 ordering because supplementary code points sort after U+FFFF. The newly allowed tag can therefore disappear from autocomplete while the user types its prefix; use a prefix query that spans the full Unicode range.Useful? React with 👍 / 👎.