-
-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to remove regular expressions
...in favour of an algorithmic approach. New features: * Add support for `silent` mode on tokenisers, which will detect whether a given value would match that tokeniser, but without eating any actual content. * Plugging into the parser is singificantly improved; * Searching for upcomming inline nodes is improved by allowing `locator`s to search for possible places where nodes start. Fixes: * Better handling of mismatched parentheses in links; * Continued block-quotes in non-GFM-mode; * Block-quotes followed by lazy definitions in commonmark-mode; * Malformed HTML block elements are no longer supported; * Bug where GFM’s literal URL detection could detect e-mail addresses without an at-character; * Bug where `mailto:` literal URLs were not properly stripped of their protocol. Todo: * A lot of places support escaped (a slash followed by another character), instead of allowing any character to be escaped, only certain characters should be supported (e.g., all ASCII-character for commonmark-mode, and several separate subsets on other flavours). Closes GH-82.
- Loading branch information
Showing
93 changed files
with
16,471 additions
and
2,580 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
build/ | ||
components/ | ||
coverage/ | ||
lib/expressions.js | ||
build.js | ||
mdast.js | ||
mdast.min.js | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
[ | ||
"article", | ||
"header", | ||
"aside", | ||
"hgroup", | ||
"blockquote", | ||
"hr", | ||
"iframe", | ||
"body", | ||
"li", | ||
"map", | ||
"button", | ||
"object", | ||
"canvas", | ||
"ol", | ||
"caption", | ||
"output", | ||
"col", | ||
"p", | ||
"colgroup", | ||
"pre", | ||
"dd", | ||
"progress", | ||
"div", | ||
"section", | ||
"dl", | ||
"table", | ||
"td", | ||
"dt", | ||
"tbody", | ||
"embed", | ||
"textarea", | ||
"fieldset", | ||
"tfoot", | ||
"figcaption", | ||
"th", | ||
"figure", | ||
"thead", | ||
"footer", | ||
"tr", | ||
"form", | ||
"ul", | ||
"h1", | ||
"h2", | ||
"h3", | ||
"h4", | ||
"h5", | ||
"h6", | ||
"video", | ||
"script", | ||
"style" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{ | ||
"default": [ | ||
"\\", | ||
"`", | ||
"*", | ||
"{", | ||
"}", | ||
"[", | ||
"]", | ||
"(", | ||
")", | ||
"#", | ||
"+", | ||
"-", | ||
".", | ||
"!", | ||
"_", | ||
">" | ||
], | ||
"gfm": [ | ||
"\\", | ||
"`", | ||
"*", | ||
"{", | ||
"}", | ||
"[", | ||
"]", | ||
"(", | ||
")", | ||
"#", | ||
"+", | ||
"-", | ||
".", | ||
"!", | ||
"_", | ||
">", | ||
"~", | ||
"|" | ||
], | ||
"commonmark": [ | ||
"\\", | ||
"`", | ||
"*", | ||
"{", | ||
"}", | ||
"[", | ||
"]", | ||
"(", | ||
")", | ||
"#", | ||
"+", | ||
"-", | ||
".", | ||
"!", | ||
"_", | ||
">", | ||
"~", | ||
"|", | ||
"\n", | ||
"\"", | ||
"$", | ||
"%", | ||
"&", | ||
"'", | ||
",", | ||
"/", | ||
":", | ||
";", | ||
"<", | ||
"=", | ||
"?", | ||
"@", | ||
"^" | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"default": [ | ||
"\\", | ||
"<", | ||
"!", | ||
"[", | ||
"_", | ||
"*", | ||
"`" | ||
], | ||
"gfm": [ | ||
"~", | ||
"http://", | ||
"https://", | ||
"mailto:" | ||
], | ||
"commonmark": [], | ||
"pedantic": [], | ||
"breaks": [ | ||
"\n" | ||
] | ||
} |
Oops, something went wrong.