477 Commits

Author SHA1 Message Date
Federico Soave
f7d4d21c0f update the list of markdown escapes, per commonmark 2018-03-06 04:35:01 +01:00
Federico Soave
209dff15ef add collapsed reference [links][] = [links][links] 2018-03-06 04:00:14 +01:00
Federico Soave
8594a066bb link labels must have at least one non-whitespace character 2018-03-06 03:54:19 +01:00
Federico Soave
f584acaaee do not process escapes in link labels 2018-03-06 03:48:31 +01:00
Federico Soave
b9394a0ec8 BREAKING CHANGE: space is no longer allowed between [link text] and [link label] in reference links.
The old behavior is now available in the pedantic mode.
To comply with commonmark: http://spec.commonmark.org/0.28/#example-514
2018-03-06 03:36:34 +01:00
Federico Soave
22b06cc36b perform space normalization when storing link reference labels 2018-03-06 03:20:28 +01:00
Federico Soave
f21a4d64c4 Revert eb95a71 "[commonmark] BREAKING CHANGE: link nesting is not allowed. If multiple links are nested, the innermost one is used."
I don't like the cm rule for nested links.
NON-COMPLIANT with commonmark.
2018-03-06 02:51:03 +01:00
Federico Soave
5b135c3945 lint marked.js 2018-03-06 02:46:15 +01:00
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