forked from MarseyWorld/MarseyWorld
regex consistency
parent
a12790622d
commit
1b3e59b7a7
|
@ -4,11 +4,11 @@ marked.use({
|
||||||
name: 'mention',
|
name: 'mention',
|
||||||
level: 'inline',
|
level: 'inline',
|
||||||
start: function(src){
|
start: function(src){
|
||||||
const match = src.match(/@[a-zA-Z0-9_\-]+/);
|
const match = src.match(/@[\w\-]{1,30}/);
|
||||||
return match != null ? match.index : -1;
|
return match != null ? match.index : -1;
|
||||||
},
|
},
|
||||||
tokenizer: function(src) {
|
tokenizer: function(src) {
|
||||||
const rule = /^@[a-zA-Z0-9_\-]+/;
|
const rule = /^@[\w\-]{1,30}/;
|
||||||
const match = rule.exec(src);
|
const match = rule.exec(src);
|
||||||
if (match){
|
if (match){
|
||||||
return {
|
return {
|
||||||
|
@ -28,11 +28,11 @@ marked.use({
|
||||||
name: 'group_mention',
|
name: 'group_mention',
|
||||||
level: 'inline',
|
level: 'inline',
|
||||||
start: function(src){
|
start: function(src){
|
||||||
const match = src.match(/![a-zA-Z0-9_\-]+/);
|
const match = src.match(/![\w\-]{3,25}/);
|
||||||
return match != null ? match.index : -1;
|
return match != null ? match.index : -1;
|
||||||
},
|
},
|
||||||
tokenizer: function(src) {
|
tokenizer: function(src) {
|
||||||
const rule = /^![a-zA-Z0-9_\-]+/;
|
const rule = /^![\w\-]{3,25}/;
|
||||||
const match = rule.exec(src);
|
const match = rule.exec(src);
|
||||||
if (match){
|
if (match){
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue