Trevor Buckner
7792adcfe6
Fix detection of orphaned emStrong delimiters ( #2203 )
2021-09-14 12:42:01 -05:00
Tony Brix
910f0f0356
fix: fix space at end of table line ( #2201 )
2021-09-08 15:20:45 -05:00
Tony Brix
21268abfba
fix: stop table at lines with only whitespace ( #2188 )
2021-08-24 21:23:53 -05:00
Tony Brix
e03b5c1f8d
fix: fix gfm urls after link ( #2186 )
2021-08-23 13:47:32 -05:00
Trevor Buckner
bc400ac789
fix: Refactor table tokens ( #2166 )
...
BREAKING CHANGE:
- `table` tokens `header` property changed to contain an array of objects for each header cell with `text` and `tokens` properties.
- `table` tokens `cells` property changed to `rows` and is an array of rows where each row contains an array of objects for each cell with `text` and `tokens` properties.
v2:
```json
{
"type": "table",
"align": [null, null],
"raw": "| a | b |\n|---|---|\n| 1 | 2 |\n",
"header": ["a", "b"],
"cells": [["1", "2"]],
"tokens": {
"header": [
[{ "type": "text", "raw": "a", "text": "a" }],
[{ "type": "text", "raw": "b", "text": "b" }]
],
"cells": [[
[{ "type": "text", "raw": "1", "text": "1" }],
[{ "type": "text", "raw": "2", "text": "2" }]
]]
}
}
```
v3:
```json
{
"type": "table",
"align": [null, null],
"raw": "| a | b |\n|---|---|\n| 1 | 2 |\n",
"header": [
{
"text": "a",
"tokens": [{ "type": "text", "raw": "a", "text": "a" }]
},
{
"text": "b",
"tokens": [{ "type": "text", "raw": "b", "text": "b" }]
}
],
"rows": [
{
"text": "1",
"tokens": [{ "type": "text", "raw": "1", "text": "1" }]
},
{
"text": "2",
"tokens": [{ "type": "text", "raw": "2", "text": "2" }]
}
]
}
```
2021-08-15 22:02:39 -05:00
Trevor Buckner
eb33d3b3a9
fix: Full Commonmark compliance for Lists ( #2112 )
2021-08-09 22:41:45 -05:00
Trevor Buckner
288f1cbe2f
Tokenizers lex their own child tokens ( #2124 )
...
BREAKING CHANGES:
- Tokenizers will create their own tokens with `this.lexer.inline(text, tokens)`. The `inline` function will queue the token creation until after all block tokens are rendered.
- `nptable` tokenizer is removed and merged with `table` tokenizer.
- Extensions tokenizer `this` object will include the `lexer` as a property. `this.inlineTokens` becomes `this.lexer.inline`.
- Extensions parser `this` object will include the `parser` as a property. `this.parseInline` becomes `this.parser.parseInline`.
- `tag` and `inlineText` tokenizer function signatures have changed.
2021-08-02 14:12:43 -05:00
Tony Brix
62d6a0e325
fix: update commonmark spec to v0.30 ( #2113 )
2021-06-25 15:14:09 -05:00
Tony Brix
af14068b99
fix: fix node v12 ( #2109 )
2021-06-16 08:48:39 -05:00
Trevor Buckner
5be9d6d70e
feat: Custom Tokenizer/Renderer extensions ( #2043 )
...
Co-authored-by: Tony Brix <tony@brix.ninja>
2021-06-15 18:22:00 -05:00
Trevor Buckner
825a9f82af
fix: em strong ( #2075 )
2021-06-01 15:26:35 -04:00
Tony Brix
6c9a8999dd
fix: fix autolink email after single space ( #2073 )
2021-05-27 11:15:32 -05:00
Tony Brix
1d973084ab
fix: call walkTokens when calling marked with a callback( #2060 )
2021-05-21 15:53:01 -05:00
Michał Krassowski
6435ac9889
fix: Fix indented markdown in html ( #2052 )
...
Co-authored-by: Tony Brix <tony@brix.ninja>
2021-05-20 08:42:45 -05:00
Tony Brix
46cdfc1ece
fix: fix items between lists ( #1936 )
2021-02-26 23:51:21 -06:00
Trevor Buckner
7293251c43
fix: Total rework of Emphasis/Strong ( #1864 )
...
BREAKING CHANGE: `em` and `strong` tokenizers have been merged into one `emStrong` tokenizer
2021-02-07 16:25:01 -06:00
Trevor Buckner
f848e77039
fix: Join adjacent inlineText tokens ( #1926 )
2021-02-07 16:22:47 -06:00
Tony Brix
1e36afde55
fix: allow sublist to be single space in pedantic ( #1924 )
2021-02-03 13:46:25 -06:00
Tony Brix
53c79ee919
fix: leave whitespace only lines alone ( #1889 )
...
* fix: leave whitespace only lines alone
* test: add whitepace_lines test
* fix: render code with trailing new line
2021-01-26 08:20:13 -06:00
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
803a6a960a
chore(dev-deps): remove eslint-plugin-standard ( #1849 )
2020-11-22 23:19:28 -06:00
Tony Brix
f9bc93b2bb
fix: fix em and strong starting with special char ( #1832 )
2020-11-19 08:30:40 -06:00
Adrian Phinney
3942e894cf
fix: task lists not rendered when GFM is disabled ( #1825 )
...
* Fix #1823 - task lists are rendered even when GFM is disabled.
* end file with a new line
Co-authored-by: Tony Brix <tony@brix.ninja>
2020-11-19 08:30:04 -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
dependabot[bot]
320aeee27b
chore(deps-dev): Bump eslint-config-standard from 14.1.1 to 16.0.1 ( #1809 )
...
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tony Brix <tony@brix.ninja>
2020-11-06 00:45:14 -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
ef2f9eecff
chore(deps): Remove markdown dependency ( #1792 )
2020-10-22 14:18:01 -05:00
Tony Brix
6355ac2d6f
fix: fix indented code in list item ( #1762 )
2020-10-21 09:38:23 -05:00
Tony Brix
c8a2b59d83
remove focused tests
2020-09-21 00:21:56 -05:00
Tony Brix
baece60557
test marked.parseInline
2020-09-20 23:01:11 -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
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
3b8358025d
test comment to end of doc
2020-08-07 11:19:47 -05:00
Dmitriy Derepko
464045ab55
Added testcase and fixed #1738
2020-08-06 19:56:06 +03:00
Steven
ba130648df
Merge pull request #1728 from flouc001/nfe/dry-run-slug
...
NFE: add dry run capabilities to default slugger
2020-07-15 08:46:24 -04:00
flouc001
75b2646687
add sequence test
2020-07-15 08:16:03 +01:00
Callum
014fbcf43f
add assertion to existing test
...
Co-authored-by: Tony Brix <tony@brix.ninja>
2020-07-15 08:03:31 +01:00
Tony Brix
dddf9ae72c
Merge pull request #1686 from calculuschild/EmphasisFixes
2020-07-13 08:34:55 -05:00
flouc001
710658cb61
use options param, update docs, update tests
2020-07-12 19:38:37 +01:00
flouc001
7c35a842a6
add dry run capabilities to default slugger
2020-07-11 09:24:46 +01:00
Tony Brix
a761316b31
Merge pull request #1726 from UziTech/show-rules
...
Add `npm run rules`
2020-07-09 16:36:18 -05:00
Tony Brix
f8193eda1a
add npm run rules
2020-07-09 12:16:43 -05: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
4db32dc180
Links are masked only once per inline string
2020-06-30 17:49:11 -04:00
Trevor Buckner
54218fe164
Remove straggling "shouldfail: false"
2020-06-17 17:09:18 -04:00
Trevor Buckner
c60c9ba4fa
Remove extra tests accidentally left in
2020-06-17 16:09:42 -04:00
jun-sheaf
fcfe15fba6
Fixed Example 272
2020-06-17 18:28:37 +02:00