51 Commits

Author SHA1 Message Date
Tony Brix
70ee29c02b
fix: fix atx heading and make regex safe (#1853) 2020-12-10 10:28:58 -06:00
Tony Brix
656c3e4aba
fix: fix link with angle brackets around href (#1851) 2020-12-10 10:27:58 -06:00
Tony Brix
d79f210aba
fix: no strikethrough on different number of tildes (#1821)
Possible Breaking Change: When using the inline.del rule the text is provided in capture group 2 instead of 1.
2020-11-14 20:03:39 -06:00
Tony Brix
5f9cafd49c
fix: list alignment (#1810)
* fix: fix list alignment

* test: add test

* test: update passing tests

* move regex to rules

* clean up code

* move item back to top
2020-11-04 15:23:04 -06:00
Tony Brix
a317912f7a fix strong overlapSkip 2020-09-07 23:45:28 -05:00
Tony Brix
9576a982ff fix underscore adjacent to asterisk 2020-09-07 21:43:28 -05:00
Steven
1d6afc1774
Merge pull request #1748 from UziTech/indented-tables
fix indented tables to follow gfm spec
2020-08-13 10:33:43 -04:00
Tony Brix
2e99532bbd fix indented tables to act like gfm 2020-08-12 16:21:46 -05:00
Plan C
69908c21f7
fix bug : Cannot break line well
Co-authored-by: Tony Brix <tony@brix.ninja>
2020-08-12 10:49:25 +08:00
Plan C
480b9f0c07
fix bug : Cannot break line well
Co-authored-by: Tony Brix <tony@brix.ninja>
2020-08-12 10:48:49 +08:00
hubenchang0515
52872d2121 fix bug : Cannot break line well [#1537](https://github.com/markedjs/marked/issues/1537)
Cannot use **(WhiteSpace)(WhiteSpace)(Return)** to break line while only one characher before it.

And if use special character, it will reset the character count

brought by [#1460](https://github.com/markedjs/marked/pull/1460)
2020-08-12 10:32:44 +08:00
Tony Brix
e39f1ef07e fix inline comment and other html blocks 2020-08-07 11:19:26 -05:00
Dmitriy Derepko
8d07cffadc
Update src/rules.js
Co-authored-by: Tony Brix <tony@brix.ninja>
2020-08-07 09:03:47 +03:00
Dmitriy Derepko
464045ab55 Added testcase and fixed #1738 2020-08-06 19:56:06 +03:00
Tony Brix
dddf9ae72c
Merge pull request #1686 from calculuschild/EmphasisFixes 2020-07-13 08:34:55 -05:00
Trevor Buckner
e27e6f960f Sorted strong and em into sub-objects 2020-07-09 19:35:22 -04:00
Trevor Buckner
226bbe70b7 Lint 2020-07-08 17:01:42 -04:00
Trevor Buckner
cc778ade42 Removed redundancy in "startEM" check 2020-07-08 16:58:58 -04:00
Trevor Buckner
211b9f9a20 Removed Lookbehinds
Beginning and End delimiters for EM and Strong must be searched in a separate regex to work without lookbehinds. This invalidates the regex that skips over blocks (code, html, etc.) that take precedence over EM or Strong blocks.

Getting around this means we must now mask not only reflinks, but all enclosed blocks which were previously just skipped over in the Regex.

Add one check for overlapping Strong block when testing EM, now passes Commonmark 390 and 471
2020-07-08 16:00:12 -04:00
Trevor Buckner
bd4f8c464b Fix unrestricted "any character" for REDOS
And remove redundant unused capture group.
2020-07-02 11:59:31 -04:00
Tony Brix
d233fd5806 mask reflinks 2020-06-20 10:25:48 -05:00
Trevor Buckner
2a45677bf0 Remove redundant regex symbols
Found a few more cases of redundant symbols in addition to fixes suggested during review.
2020-06-18 10:00:27 -04:00
Randolf C
463f49d90c
Update src/rules.js
Co-authored-by: Tony Brix <tony@brix.ninja>
2020-06-17 17:27:35 +02:00
Trevor Buckner
335a6601d4 Added fixes to Strong
Fixes examples 391, 397, 399, 400, 401, 431, 443, 475, 476, 479, and 480
2020-06-17 11:06:25 -04:00
jun-sheaf
5920cf9cf8 Updated rules and created tests. 2020-06-17 11:50:00 +02:00
Trevor Buckner
4cbba074d6 Moved logic into Tokenizer. No longer injecting Reflinks
Reflinks are replaced with the string 'aaaa' of equal length to hide any asterisks or underscores that might have been inside, since these should not be included. Then, the resulting string is matched to the em regex. The positions of the captures are then used on the original string.
2020-06-17 00:41:06 -04:00
Trevor Buckner
556070bffc Updated rules for underscore em
Now fixes three more cases
2020-06-12 16:29:25 -04:00
Trevor Buckner
bc17deddb6 Lint 2020-06-12 15:37:18 -04:00
Trevor Buckner
7c6551e542 Properly handle reflinks that should be escaped
Modifies the em rule after the block tokens are generated to detect known reflinks and skip over them so they don't get mistakenly italicized.
2020-06-12 15:30:25 -04:00
Trevor Buckner
c38ee23f45 Fix Pedantic 2020-05-29 20:53:58 -04:00
Trevor Buckner
283ab9cf8a Deleted an extra line while removing comments 2020-05-29 16:33:49 -04:00
Trevor Buckner
4e2ec90374 Now passes several more tests
Added a check for the previous character to the  *em* Tokenizer. Needed to pass any tests where the em block starts with a punctuation character (e.g. commonmark example 368)
2020-05-29 16:25:46 -04:00
Trevor Buckner
40493bbc28 Follow GFM spec on Left-flanking-delimiter-runs 2020-05-21 12:56:31 -04:00
Tony Brix
d57c89d00e fix redos 2020-05-20 10:23:42 -05:00
Tony Brix
48448cc24f fix image links with escaped brackets 2020-05-19 15:58:33 -05:00
Tony Brix
61bc4ba78a fix underscore emphasis then comma 2020-05-02 01:13:46 -05:00
Ivan Demidov
5193c32233
Merge branch 'master' into fix/closing-delimited 2020-04-14 16:21:07 +03:00
Ivan Demidov
2c903bf88a fix: closing delimited, close issue #1594 2020-04-14 10:20:48 +03:00
Ivan Demidov
af9ff6772f fix: italics-modifier, close issue #1284 2020-04-13 12:03:57 +03:00
Ivan Demidov
6fc0721482 perf: regexp for em, close #1607 2020-04-03 14:40:34 +03:00
Tony Brix
431f523419 remove unneeded code 2020-03-09 14:20:32 -05:00
Tony Brix
cbcda26637 copy table rules to nptables 2020-03-09 11:02:26 -05:00
Tony Brix
8f1917e814
Merge pull request #1598 from calculuschild/table-block-breaks
Fix GFM tables not breaking on block-level structures
2020-03-06 14:16:32 -06:00
Trevor Buckner
5972e73b0f
Update fences after tables regex
Fences after tables fixed in line with PR #1600.
2020-02-11 11:32:43 -05:00
Trevor Buckner
ec38dd1d0b
Remove + on heading regex
Unneeded + on regex heading detection after tables and paragraphs
2020-02-11 11:30:33 -05:00
Trevor Buckner
63454d2457 Fix GFM Example 116
Only code fences made from backticks cannot have other backticks in the same line. Fences with tildes can have both tildes and backticks. This allows the tilde case to work correctly.

Also test for detection of these fences as they break or do not break paragraphs.
2020-02-10 16:06:38 -05:00
Trevor Buckner
30ca83bdf5
Update src/rules.js
Simplify `code` regex

Co-Authored-By: Tony Brix <tony@brix.ninja>
2020-02-10 15:09:19 -05:00
Trevor Buckner
a7949596ce
Removed console.log 2020-02-05 10:58:43 -05:00
Trevor Buckner
090d11e1c6 Fix GFM tables not breaking on block-level structures
Includes test cases for all block-level structures and some inline-level structures (which should still appear in the table)
2020-02-04 23:46:34 -05:00
Mateusz Burzyński
34df290fd0 Remove static properties from helpers 2019-12-04 21:14:51 +01:00