From cae709b39c1f3a2000dbfdd62bf9e71dffd95357 Mon Sep 17 00:00:00 2001
From: marihachi <marihachi0620@gmail.com>
Date: Sat, 5 Jun 2021 16:57:56 +0900
Subject: [PATCH] update alt url syntax

---
 src/parser.pegjs | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/parser.pegjs b/src/parser.pegjs
index f350763..34233e0 100644
--- a/src/parser.pegjs
+++ b/src/parser.pegjs
@@ -354,7 +354,7 @@ hashtagChar
 // inline: URL
 
 url
-	= "<" url:urlFormat ">"
+	= "<" url:altUrlFormat ">"
 {
 	return N_URL(url);
 }
@@ -364,14 +364,11 @@ url
 }
 
 urlFormat
-	= "http" "s"? "://" urlContent
+	= "http" "s"? "://" urlContentPart+
 {
 	return text();
 }
 
-urlContent
-	= urlContentPart+
-
 urlContentPart
 	= urlBracketPair
 	/ [.,] &urlContentPart // last char is neither "." nor ",".
@@ -381,6 +378,12 @@ urlBracketPair
 	= "(" urlContentPart* ")"
 	/ "[" urlContentPart* "]"
 
+altUrlFormat
+	= "http" "s"? "://" (!">" CHAR)+
+{
+	return text();
+}
+
 // inline: link
 
 link
-- 
GitLab