Fix the topic validation rule and suport dots (#26286)

1. Allow leading and trailing spaces by user input, these spaces have
already been trimmed at backend
2. Allow using dots in the topic
This commit is contained in:
wxiaoguang 2023-08-03 17:18:06 +08:00 committed by GitHub
parent cad22512b8
commit 539015403f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 3 deletions

View file

@ -166,7 +166,7 @@ export function initRepoTopicBar() {
rules: [
{
type: 'validateTopic',
value: /^[a-z0-9][a-z0-9-]{0,35}$/,
value: /^\s*[a-z0-9][-.a-z0-9]{0,35}\s*$/,
prompt: topicPrompts.formatPrompt
},
{