Alex Kocharin
75037c6514
Put escape sequences into separate token
3 years ago
Mizux
c7e36eb12d
Fix typo
3 years ago
Vitaly Puzrin
ffc49ab46b
Fix possible ReDOS in newline rule.
Co-authored-by: MakeNowJust <make.just.on@gmail.com>
3 years ago
Alex Kocharin
1cd8a5143b
Fix tab preventing paragraph continuation in lists
close https://github.com/markdown-it/markdown-it/issues/830
3 years ago
Alex Kocharin
24abaa51a6
Improve emphasis algorithm
This fixes quadratic complexity in `**<...>**a**<...>**`
pathological case.
3 years ago
Himanshu Mehta
e07a9ddeee
typo fix
3 years ago
Eddie Kohler
8bcc82aa74
Parser: Set ordered list_item_open token info to input marker.
For instance, in a list
1. Item 1
20. Item 2
the first list_item_open token will have token.info === '1', and the
second will have token.info === '20'.
This is useful for later rendering plugins that might want to
use the actual markers.
3 years ago
Taneli Hukkinen
e5986bb7cc
Always suffix indented code block with a newline
3 years ago
Alex Kocharin
eed156e9cd
Fix emphasis algorithm as per 0.30 spec
https://github.com/commonmark/cmark/issues/383
3 years ago
Alex Kocharin
0b14fa069f
Update CommonMark spec to 0.30
3 years ago
Vitaly Puzrin
064d602c68
Updated highlight.js usage info
- Ref #779
4 years ago
Taneli Hukkinen
272a470ed2
Fix newline not rendered in image alt attribute
4 years ago
Alex Kocharin
309c03a9e8
Lower priority for ATX headers to resolve conflict with HTML blocks
fix https://github.com/markdown-it/markdown-it/issues/772
4 years ago
Taneli Hukkinen
cd5296f1e7
Fix table/list parsing ambiguity ( #767 )
4 years ago
Taneli Hukkinen
32564bad8d
Clarify `Token.info` comment
4 years ago
Vitaly Puzrin
c9949dd585
Avoid fenced token mutation, #745
4 years ago
Alex Kocharin
c9dd942246
Fix crash when processing strikethrough
close https://github.com/markdown-it/markdown-it/issues/742
4 years ago
Alex Kocharin
ddbb195546
Remove meta from list of block html tags
ref https://github.com/commonmark/commonmark-spec/issues/527
4 years ago
Alex Kocharin
8ad16ac4d9
Allow EOL in processing instructions
same fix as in https://github.com/commonmark/commonmark.js/issues/196
4 years ago
Alex Kocharin
e729b90a1d
Fix quadratic complexity in autolinks
close https://github.com/markdown-it/markdown-it/issues/737
4 years ago
Alex Kocharin
8cd6fc34c4
Fix quadratic compexity on backticks
close https://github.com/markdown-it/markdown-it/issues/736
4 years ago
Alex Kocharin
2290e109c5
Disallow escaped spaces inside link destination
4 years ago
Alex Kocharin
83b05755db
Fix quadratic time on emphasis
close https://github.com/markdown-it/markdown-it/issues/735
4 years ago
Alex Kocharin
537ab89d7c
Don't try to parse link title if link wasn't found
4 years ago
Alex Kocharin
fece91e265
Fix backtick algorithm
now it more closely matches one in `cmark`
4 years ago
Alex Kocharin
b1651b1363
Stop link title parsing when second `(` is found
`[](url (xxx())` is no longer a valid link
4 years ago
Alex Kocharin
1e8aff0084
Fix quadratic time on backticks
This commit adds a cache `StateInline->backticks` which remembers
positions for every possible backtick closer (`, ``, ```, etc.).
Algorithm is similar to one described here:
685b714453
close https://github.com/markdown-it/markdown-it/issues/733
4 years ago
Alex Kocharin
1910a3cdb2
Limit () nesting inside urls
Allow no more than 32 levels of nesting in `[]( (((((....))))) )`
for performance reasons.
close https://github.com/markdown-it/markdown-it/issues/732
4 years ago
Alex Kocharin
f688abccaf
Stop link parsing when second `<` is found
`[](<foo<bar>)` is no longer a valid link
4 years ago
Alex Kocharin
b56eeb01d9
Table with no columns is no longer a table
this is now just raw text:
```md
|
|
|
```
close https://github.com/markdown-it/markdown-it/issues/724
4 years ago
Alex Kocharin
75fe6e0c76
Fix tables inside lists indented with tabs
close https://github.com/markdown-it/markdown-it/issues/721
4 years ago
Vitaly Puzrin
564de6b249
Deps bump & related updates
4 years ago
Alex Kocharin
f156ed1bff
Don't decode %25 in beautified urls
fix https://github.com/markdown-it/markdown-it/issues/720
4 years ago
Alex Kocharin
9fe835bc12
Fix mappings for table rows
- `table`, `tbody`, `tr` now have mapping
- `th`, `td`, `inline` in tables do not have it
close https://github.com/markdown-it/markdown-it/issues/705
4 years ago
Alex Kocharin
866fba34a2
Add lang str remainder to highlight callback
``` javascript {line-numbers=5 highlight=14-17}
test
```
This markup now calls `highlight` like this:
require('markdown-it')({
highlight(code, lang, attrs) {
assert(code === 'test')
assert(lang === 'javascript')
assert(attrs === '{line-numbers=5 highlight=14-17}')
}
})
close https://github.com/markdown-it/markdown-it/issues/626
close https://github.com/markdown-it/markdown-it/pull/706
4 years ago
Alex Kocharin
3021a5207b
Bring pipe escape algorithm in tables closer to gfm
- table now doesn't deal with backticks at all
- `|` is considered escaped if and only if there is a `\` character immediately before it
- number of elements in the first row (thead) now must match second row (aligns) exactly
- no tbody if it would be empty
close https://github.com/markdown-it/markdown-it/issues/689
close https://github.com/markdown-it/markdown-it/pull/697
4 years ago
Vas Sudanagunta
6629917dec
Remove unnecessary calculation
4 years ago
ocavue
b979ca01d5
fix: remove unused comparison code
4 years ago
Alex Kocharin
0b1699b034
Add missing line mapping for table rows
fix https://github.com/markdown-it/markdown-it/issues/705
4 years ago
Alex Kocharin
805c69528d
Fix smartquotes adjacent to code block
close https://github.com/markdown-it/markdown-it/issues/677
4 years ago
Alex Kocharin
b3531c876e
Fix blockquotes
```
>>> foo
> bar
>>> baz
```
this is now a single blockquote as per spec
close https://github.com/markdown-it/markdown-it/issues/696
4 years ago
Philipp_Lypniakov
5c1e80aa26
Fix typos
5 years ago
Alex Kocharin
f798bea962
Allow opening quote after another punctuation char in typographer
close https://github.com/markdown-it/markdown-it/issues/643
5 years ago
Alex Kocharin
3c427f921e
Fix em- and en-dashes not being typographed when separated by 1 char
close https://github.com/markdown-it/markdown-it/issues/624
5 years ago
Vitaly Puzrin
3d24bda404
Deps bump
5 years ago
Alex Kocharin
07a62c6c75
Move nested delimiter info to opening token instead of inline state
5 years ago
Mathias Bynens
faecae0ba7
Match CommonMark spec exactly
5 years ago
Mathias Bynens
d9cb3ccb67
Don’t recognize U+2028 as a newline character
As of https://github.com/tc39/proposal-json-superset (ES2019), U+2028 is allowed in ECMAScript string literals, just like it already was in JSON strings. Splitting on U+2028 breaks the layout of a Markdown file containing a code example:
https://markdown-it.github.io/#md3=%7B%22source%22%3A%22a%5Cn%5Cn%5Cn%60%60%60js%5Cn%2F%2F%20A%20JavaScript%20object%20%28or%20array%2C%20or%20string%29%20representing%20some%20data.%5Cnconst%20data%20%3D%20%7B%5Cn%20%20LineTerminators%3A%20%27%5C%5Cn%5C%5Cr%E2%80%A8%E2%80%A9%27%2C%20%2F%2F%20%27%5C%5Cn%5C%5Cr%5C%5Cu2028%5C%5Cu2029%27%5Cn%7D%3B%5Cn%60%60%60%5Cn%5Cnb%22%2C%22defaults%22%3A%7B%22html%22%3Afalse%2C%22xhtmlOut%22%3Afalse%2C%22breaks%22%3Afalse%2C%22langPrefix%22%3A%22language-%22%2C%22linkify%22%3Atrue%2C%22typographer%22%3Atrue%2C%22_highlight%22%3Atrue%2C%22_strict%22%3Afalse%2C%22_view%22%3A%22html%22%7D%7D
This patch removes U+2028 as a newline character, to align markdown-it’s behavior more closely with the JavaScript string literal grammar.
5 years ago
Alex Kocharin
a1c93811f8
Fix incorrect level recalculation in text_collapse
close #466
5 years ago
Alex Kocharin
d08c7c3897
Add an example related to case-insensitive comparisons
5 years ago