Skip to content
Snippets Groups Projects
Commit af90a338 authored by marihachi's avatar marihachi
Browse files

Enable restricted syntaxes.

parent f9d9ded4
No related branches found
No related tags found
No related merge requests found
...@@ -116,22 +116,6 @@ inline ...@@ -116,22 +116,6 @@ inline
/ fnVer1 / fnVer1
/ inlineText / inlineText
inlineWithoutFn
= emojiCode
/ unicodeEmoji
/ big
/ bold
/ small
/ italic
/ strike
/ inlineCode
/ mathInline
/ mention
/ hashtag
/ url
/ link
/ inlineText
plain plain
= emojiCode = emojiCode
/ unicodeEmoji / unicodeEmoji
...@@ -357,21 +341,15 @@ hashtag ...@@ -357,21 +341,15 @@ hashtag
} }
hashtagContent hashtagContent
= hashtagChar+ { return text(); } = (hashtagBracketPair / hashtagChar)+ { return text(); }
hashtagChar
= ![ \t.,!?'"#:\/【】] CHAR
// hashtagContent
// = (hashtagBracketPair / hashtagChar)+ { return text(); }
// hashtagBracketPair hashtagBracketPair
// = "(" hashtagContent* ")" = "(" hashtagContent* ")"
// / "[" hashtagContent* "]" / "[" hashtagContent* "]"
// / "「" hashtagContent* "」" / "「" hashtagContent* "」"
// hashtagChar hashtagChar
// = ![ \t.,!?'"#:\/\[\]【】()「」] CHAR = ![ \t.,!?'"#:\/\[\]【】()「」] CHAR
// inline: URL // inline: URL
...@@ -395,17 +373,13 @@ urlContent ...@@ -395,17 +373,13 @@ urlContent
= urlContentPart+ = urlContentPart+
urlContentPart urlContentPart
= [.,] &urlContentPart // last char is neither "." nor ",". = urlBracketPair
/ [.,] &urlContentPart // last char is neither "." nor ",".
/ [a-z0-9_/:%#@$&?!~=+-]i / [a-z0-9_/:%#@$&?!~=+-]i
// urlContentPart urlBracketPair
// = urlBracketPair = "(" urlContentPart* ")"
// / [.,] &urlContentPart // last char is neither "." nor ",". / "[" urlContentPart* "]"
// / [a-z0-9_/:%#@$&?!~=+-]i
// urlBracketPair
// = "(" urlContentPart* ")"
// / "[" urlContentPart* "]"
// inline: link // inline: link
...@@ -419,17 +393,12 @@ linkLabel ...@@ -419,17 +393,12 @@ linkLabel
= parts:linkLabelPart+ = parts:linkLabelPart+
{ {
return parts; return parts;
//return parts.flat(Infinity);
} }
// linkLabelPart
// = url { return text(); /* text node */ }
// / link { return text(); /* text node */ }
// / !"]" n:inline { return n; }
linkLabelPart linkLabelPart
// = "[" linkLabelPart* "]" = url { return text(); /* text node */ }
= !"]" p:plain { return p; } / link { return text(); /* text node */ }
/ !"]" n:inline { return n; }
linkUrl linkUrl
= url { return text(); } = url { return text(); }
...@@ -471,7 +440,7 @@ fnArg ...@@ -471,7 +440,7 @@ fnArg
} }
fnContentPart fnContentPart
= !("]") i:inlineWithoutFn { return i; } = !("]") i:inline { return i; }
// inline: text // inline: text
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment