469 Commits

Author SHA1 Message Date
Federico Soave
ef3516ce60 !fixup eb95a71 2018-03-06 02:45:48 +01:00
Federico Soave
eb95a718a4 [commonmark] BREAKING CHANGE: link nesting is not allowed. If multiple links are nested, the innermost one is used. 2018-03-06 02:35:19 +01:00
Federico Soave
8877ff7adf [refactor] rename rule inside -> label 2018-03-06 00:40:50 +01:00
Federico Soave
47365c124e allow brackets in link text if they are inside a code span. Add test. 2018-03-06 00:40:07 +01:00
Federico Soave
271d35705a [security] fix possible ReDOS vulnerable regex rule by refactoring (doesn't change the alphabet) 2018-03-06 00:17:16 +01:00
Federico Soave
3afc360cf9 allow link titles to be wrapped in parenthesis 2018-03-06 00:02:40 +01:00
Federico Soave
d8ff951f8b allow unbalanced parenthesis in links URIs wrapped in angle brackets 2018-03-05 23:33:30 +01:00
Federico Soave
9f20c46829 allow ONE level of matching parenthesis in links.
NON-COMPLIANT with commonmark!
adjust test #468 accordingly.
2018-03-05 23:21:52 +01:00
Federico Soave
fc17a2c4ad allow backslash-escapes in link text, href, title and link definition references.
InlineLexer.escapes() handles markdown escapes sequences.
TODO handle escapes everywhere in the document.
2018-03-05 23:12:52 +01:00
Federico Soave
e66f7aa7b9 don't allow spaces in link URIs 2018-03-05 22:15:50 +01:00
Federico Soave
3be817b0e7 save current link parsing in pedantic mode 2018-03-05 22:10:49 +01:00
Federico Soave
821e2dafd4 allow matched double quotes in link definition title only in pedantic mode 2018-03-05 22:10:49 +01:00
Federico Soave
bf9c9c50bf Revert fac31ed "allow matched double quotes in link definition title (markdown.pl behavior)." 2018-03-05 22:10:49 +01:00
Federico Soave
d2cef5abc9 escape html entities in link/image href 2018-03-05 22:10:49 +01:00
Federico Soave
de66018d67 encode urls with %xx entities 2018-03-05 22:10:48 +01:00
Federico Soave
d08039e1f2 new rule for html blocks, to comply with commonmark.
BREAKING CHANGE: inline markdown is not parsed inside html blocks.
2018-03-04 16:23:38 +01:00
Federico Soave
56972f82a4 save the current html block parsing in the pedantic mode 2018-03-04 16:12:22 +01:00
Federico Soave
1b8ca2bee0 option pedantic overrides gfm, and turns off gfm, tables and breaks.
FIXME update README
2018-03-04 16:03:17 +01:00
Federico Soave
8e30cd2e51 !fixup b2611c1b05
Disallow colons in tag names
2018-03-04 03:40:23 +01:00
Federico Soave
4de3c98282 refactor html block rule 2018-03-04 03:00:37 +01:00
Federico Soave
27d4da6d38 refactor tag inline rule 2018-03-04 03:00:34 +01:00
Federico Soave
f2ebd4310a allow a regex source string as a parameter for edit() 2018-03-04 03:00:11 +01:00
Federico Soave
b2611c1b05 allow colons in tag names and attributes. Decrease group depth in regex 2018-03-04 02:54:19 +01:00
Federico Soave
652ba97a2c new html comment rule to comply with commonmark (html5).
non-compliant: allow `--` inside html comments.
adjust inline tag rule accordingly.
2018-03-04 02:52:33 +01:00
Federico Soave
9450b09132 new inline html rule, to comply with commonmark 2018-03-04 02:47:47 +01:00
Federico Soave
55ab987d44
Merge branch 'master' into lint 2018-02-23 19:33:34 +01:00
Tony Brix
9a757fc19e remove parens 2018-02-18 19:32:34 -06:00
Tony Brix
bed875bf46 revert number of capturing parens in #1013
fixes #1059
2018-02-18 19:12:40 -06:00
Federico Soave
ad6484b90c !fixup 565b4a0e5b 2018-02-13 22:09:27 +01:00
Federico Soave
560c5cb13b Merge branch 'master' into lint 2018-01-26 04:57:18 +01:00
Federico Soave
b8437b0742 fix underscore emphasis (apply commonmark flanking rule and rule 12) 2018-01-25 17:10:10 +01:00
kythyria
1c780b9985 Fix the regexes for thematic breaks
Commonmark and GFM both agree that -_- is literal characters, not <hr>,
as all three characters must be the same.

Also change the test harness to only look for .text and .html files
since it was choking on vim's swapfiles.

And add some tests to catch what this fixes.
2018-01-25 17:08:13 +01:00
Josh Bruce
33b444c360
Merge pull request #1033 from Feder1co5oave/quotes_in_titles
Make legacy test literal_quotes_in_titles pass
2018-01-24 19:31:45 -05:00
Federico Soave
fac31ed978 allow matched double quotes in link definition title (markdown.pl behavior).
Test literal_quotes_in_titles now passes.
fixup! c3e00590
2018-01-23 17:03:08 +01:00
Federico Soave
ca455a68de gfm autolinks: backpedal on trailing punctuation
(see https://github.github.com/gfm/#extended-autolink-path-validation)
2018-01-23 16:29:31 +01:00
Federico Soave
187d46f294 email address domain must contain at least a dot and must not end with dash or underscore 2018-01-23 16:29:31 +01:00
Federico Soave
00f1f7a239 new gfm autolink rule: http/www URLs and email addresses 2018-01-23 16:29:31 +01:00
Federico Soave
a8f2d7ff6e new rule for autolinks, adjust html rules accordingly.
test 574 does not pass because of url encoding FIXME)
2018-01-22 19:03:15 +01:00
Cory Forsyth
6d974b1dbf Do not autolink a trailing "!" in a URL
* Expand gfm link tests to include all possible ending punctuation
2018-01-22 19:03:14 +01:00
Josh Bruce
024e378f43
Merge pull request #682 from Feder1co5oave/fix_typeerror
Throw error on non-string input
2018-01-20 17:16:11 -05:00
Josh Bruce
68aab24f7e
Merge pull request #1023 from Feder1co5oave/new_blockquote
[commonmark] Make blockquotes commonmark compliant
2018-01-20 17:14:44 -05:00
Josh Bruce
19f6afe4aa
Merge pull request #456 from Feder1co5oave/clean-segments
IDs of headings with inline tokens (link, em, bold...)
2018-01-20 16:09:27 -05:00
Josh Bruce
a98bad2430
Merge pull request #1013 from Feder1co5oave/fix-backticks2
fix backticks in inline code (replaces #503, fixes #312)
2018-01-20 15:46:19 -05:00
Josh Bruce
a78d51f775
Merge pull request #1014 from AndyLnd/master
chore: remove unused flags variable
2018-01-20 15:38:27 -05:00
Federico Soave
3bbcc885dd [lint] fix already declared/unused variables 2018-01-20 03:21:46 +01:00
Federico Soave
565b4a0e5b [lint] make the outer function a recognizable IIFE 2018-01-20 03:12:08 +01:00
Federico Soave
d9c471e265 [lint] fix var declarations 2018-01-20 03:12:08 +01:00
Federico Soave
1a19028b66 [lint] fix whitespace 2018-01-20 03:12:08 +01:00
Federico Soave
7e1836f547 [lint] add parens to empty constructor calls 2018-01-20 03:12:03 +01:00
Federico Soave
b2edbd6464 [lint] refactor replace() with an OOP approach. ESlint is happier. 2018-01-20 03:11:56 +01:00