update alt url syntax

This commit is contained in:
marihachi 2021-06-05 16:57:56 +09:00
parent c2c629509d
commit cae709b39c

View file

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