From 445438a55754dc52fd396a4af9af22232060c39c Mon Sep 17 00:00:00 2001 From: marihachi Date: Sat, 5 Jun 2021 17:30:23 +0900 Subject: [PATCH] disallow a hashtag with only numbers --- src/parser.pegjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/parser.pegjs b/src/parser.pegjs index feb0fdc..342cfcb 100644 --- a/src/parser.pegjs +++ b/src/parser.pegjs @@ -341,7 +341,10 @@ hashtag } hashtagContent - = !([0-9]+ !hashtagContentPart) hashtagContentPart+ { return text(); } + = !(invalidHashtagContent !hashtagContentPart) hashtagContentPart+ { return text(); } + +invalidHashtagContent + = [0-9]+ hashtagContentPart = hashtagBracketPair / hashtagChar