regex consistency

pull/199/head
Aevann 2023-09-15 01:22:10 +03:00
parent a12790622d
commit 1b3e59b7a7
1 changed files with 4 additions and 4 deletions

View File

@ -4,11 +4,11 @@ marked.use({
name: 'mention',
level: 'inline',
start: function(src){
const match = src.match(/@[a-zA-Z0-9_\-]+/);
const match = src.match(/@[\w\-]{1,30}/);
return match != null ? match.index : -1;
},
tokenizer: function(src) {
const rule = /^@[a-zA-Z0-9_\-]+/;
const rule = /^@[\w\-]{1,30}/;
const match = rule.exec(src);
if (match){
return {
@ -28,11 +28,11 @@ marked.use({
name: 'group_mention',
level: 'inline',
start: function(src){
const match = src.match(/![a-zA-Z0-9_\-]+/);
const match = src.match(/![\w\-]{3,25}/);
return match != null ? match.index : -1;
},
tokenizer: function(src) {
const rule = /^![a-zA-Z0-9_\-]+/;
const rule = /^![\w\-]{3,25}/;
const match = rule.exec(src);
if (match){
return {