Fix username/mention regexes
* Allow underscore instead of hypen * Fix domain part handling * Add tests for remote mention
This commit is contained in:
parent
34281de04e
commit
3c4235067f
6 changed files with 17 additions and 7 deletions
|
|
@ -76,7 +76,7 @@ export default Vue.extend({
|
|||
}
|
||||
|
||||
const err =
|
||||
!this.username.match(/^[a-zA-Z0-9\-]+$/) ? 'invalid-format' :
|
||||
!this.username.match(/^[a-zA-Z0-9_]+$/) ? 'invalid-format' :
|
||||
this.username.length < 3 ? 'min-range' :
|
||||
this.username.length > 20 ? 'max-range' :
|
||||
null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue