Skip to content

Commit 6479bb4

Browse files
authored
Merge pull request #18 from stanley2058/master
feature/merge upstream 14.1.0
2 parents c49d7b7 + 511dd88 commit 6479bb4

File tree

174 files changed

+29675
-23650
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+29675
-23650
lines changed

.eslintrc.yml

Lines changed: 15 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -1,151 +1,22 @@
1-
env:
2-
node: true
3-
browser: false
4-
es6: false
1+
extends: standard
2+
3+
overrides:
4+
-
5+
files: [ '*.mjs' ]
6+
rules:
7+
no-restricted-globals: [ 2, require, __dirname ]
8+
-
9+
files: [ 'test/**' ]
10+
env: { mocha: true }
11+
-
12+
files: [ 'lib/**' ]
13+
parserOptions: { ecmaVersion: 2015 }
514

615
ignorePatterns:
7-
- coverage/
816
- demo/
917
- dist/
10-
- node_modules
11-
- support/demo_template/sample.js
1218
- benchmark/extra/
13-
- rollup.config.js
1419

1520
rules:
16-
accessor-pairs: 2
17-
array-bracket-spacing: [ 2, "always", { "singleValue": true, "objectsInArrays": true, "arraysInArrays": true } ]
18-
block-scoped-var: 2
19-
block-spacing: 2
20-
brace-style: [ 2, '1tbs', { allowSingleLine: true } ]
21-
# Postponed
22-
#callback-return: 2
23-
comma-dangle: 2
24-
comma-spacing: 2
25-
comma-style: 2
26-
computed-property-spacing: [ 2, never ]
27-
consistent-this: [ 2, self ]
28-
consistent-return: 2
29-
# ? change to multi
30-
curly: [ 2, 'multi-line' ]
31-
dot-notation: 2
32-
eol-last: 2
33-
eqeqeq: 2
34-
func-style: [ 2, declaration ]
35-
# Postponed
36-
#global-require: 2
37-
guard-for-in: 2
38-
handle-callback-err: 2
39-
40-
indent: [ 2, 2, { VariableDeclarator: { var: 2, let: 2, const: 3 }, SwitchCase: 1, ignoreComments: true } ]
41-
42-
# key-spacing: [ 2, { "align": "value" } ]
43-
keyword-spacing: 2
44-
linebreak-style: 2
45-
max-depth: [ 1, 6 ]
46-
max-nested-callbacks: [ 1, 4 ]
47-
# string can exceed 80 chars, but should not overflow github website :)
48-
max-len: [ 2, 120, 1000 ]
49-
new-cap: 2
50-
new-parens: 2
51-
# Postponed
52-
#newline-after-var: 2
53-
no-alert: 2
54-
no-array-constructor: 2
55-
no-bitwise: 2
56-
no-caller: 2
57-
#no-case-declarations: 2
58-
no-catch-shadow: 2
59-
no-cond-assign: 2
60-
no-console: 1
61-
no-constant-condition: 2
62-
#no-control-regex: 2
63-
no-debugger: 2
64-
no-delete-var: 2
65-
no-div-regex: 2
66-
no-dupe-args: 2
67-
no-dupe-keys: 2
68-
no-duplicate-case: 2
69-
no-else-return: 2
70-
# Tend to drop
71-
# no-empty: 1
72-
no-empty-character-class: 2
73-
no-empty-pattern: 2
74-
no-eq-null: 2
75-
no-eval: 2
76-
no-ex-assign: 2
77-
no-extend-native: 2
78-
no-extra-bind: 2
79-
no-extra-boolean-cast: 2
80-
no-extra-semi: 2
81-
no-fallthrough: 2
82-
no-floating-decimal: 2
83-
no-func-assign: 2
84-
# Postponed
85-
#no-implicit-coercion: [2, { "boolean": true, "number": true, "string": true } ]
86-
no-implied-eval: 2
87-
no-inner-declarations: 2
88-
no-invalid-regexp: 2
89-
no-irregular-whitespace: 2
90-
no-iterator: 2
91-
no-label-var: 2
92-
no-labels: 2
93-
no-lone-blocks: 2
94-
no-lonely-if: 2
95-
no-loop-func: 2
96-
no-mixed-requires: 2
97-
no-mixed-spaces-and-tabs: 2
98-
# Postponed
99-
#no-native-reassign: 2
100-
no-negated-in-lhs: 2
101-
# Postponed
102-
#no-nested-ternary: 2
103-
no-new: 2
104-
no-new-func: 2
105-
no-new-object: 2
106-
no-new-require: 2
107-
no-new-wrappers: 2
108-
no-obj-calls: 2
109-
no-octal: 2
110-
no-octal-escape: 2
111-
no-path-concat: 2
112-
no-proto: 2
113-
no-redeclare: 2
114-
# Postponed
115-
#no-regex-spaces: 2
116-
no-return-assign: 2
117-
no-self-compare: 2
118-
no-sequences: 2
119-
no-shadow: 2
120-
no-shadow-restricted-names: 2
121-
no-sparse-arrays: 2
122-
no-trailing-spaces: 2
123-
no-undef: 2
124-
no-undef-init: 2
125-
no-undefined: 2
126-
no-unexpected-multiline: 2
127-
no-unreachable: 2
128-
no-unused-expressions: 2
129-
no-unused-vars: 2
130-
no-use-before-define: 2
131-
no-void: 2
132-
no-with: 2
133-
object-curly-spacing: [ 2, always, { "objectsInObjects": true, "arraysInObjects": true } ]
134-
operator-assignment: 1
135-
# Postponed
136-
#operator-linebreak: [ 2, after ]
137-
semi: 2
138-
semi-spacing: 2
139-
space-before-function-paren: [ 2, { "anonymous": "always", "named": "never" } ]
140-
space-in-parens: [ 2, never ]
141-
space-infix-ops: 2
142-
space-unary-ops: 2
143-
# Postponed
144-
#spaced-comment: [ 1, always, { exceptions: [ '/', '=' ] } ]
145-
strict: [ 2, global ]
146-
quotes: [ 2, single, avoid-escape ]
147-
quote-props: [ 1, 'as-needed' ]
148-
radix: 2
149-
use-isnan: 2
150-
valid-typeof: 2
151-
yoda: [ 2, never, { "exceptRange": true } ]
21+
camelcase: 0
22+
no-multi-spaces: 0

.github/FUNDING.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
open_collective: puzrin
2-
patreon: puzrin
1+
github: markdown-it
2+
open_collective: markdown-it
33
tidelift: "npm/markdown-it"

.github/ISSUE_TEMPLATE/question.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ assignees: ''
99

1010
<!--
1111
12-
Note, we have some time constrains, but we always try to help developers, who write plugins. So:
12+
Note, we have some time constraints, but we always try to help developers, who write plugins. So:
1313
1414
- Please, avoid generic programming questions.
1515
- Avoid questions about markdown. Use CommonMark resources for that https://commonmark.org/.

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: daily
7+
8+
- package-ecosystem: npm
9+
directory: /
10+
schedule:
11+
interval: daily
12+
allow:
13+
- dependency-type: production

.github/workflows/ci.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
node-version: [ '12', '14' ]
16+
node-version: [ '18' ]
1717

1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v4
2020

2121
- name: Use Node.js ${{ matrix.node-version }}
22-
uses: actions/setup-node@v1
22+
uses: actions/setup-node@v4
2323
with:
2424
node-version: ${{ matrix.node-version }}
2525

@@ -28,10 +28,7 @@ jobs:
2828
- name: Test
2929
run: npm test
3030

31-
- name: Create coverage report
32-
run: npm run report-coveralls
33-
3431
- name: Upload coverage report to coveralls.io
35-
uses: coverallsapp/github-action@v1.1.2
32+
uses: coverallsapp/github-action@master
3633
with:
3734
github-token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
.nyc_output
21
benchmark/extra/
32
node_modules/
43
coverage/

CHANGELOG.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,92 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88

9+
## [14.1.0] - 2024-03-19
10+
### Changed
11+
- Updated CM spec compatibility to 0.31.2, #1009.
12+
13+
### Fixed
14+
- Fixed quadratic complexity when parsing references, #996.
15+
- Fixed quadratic output size with pathological user input in tables, #1000.
16+
17+
18+
## [14.0.0] - 2023-12-08
19+
### Changed
20+
- Drop ancient browsers support (use `.fromCodePoint` and other features).
21+
- Rewrite to ESM (including all plugins/deps). CJS fallback still available.
22+
No signatures changed, except `markdown-it-emoji` plugin.
23+
- Dropped `dist/` folder from repo, build on package publish.
24+
- Set `punicode.js` as external dependency.
25+
26+
### Fixed
27+
- Html tokens inside img alt are now rendered as their original text, #896.
28+
- Hardbreaks inside img alt are now rendered as newlines.
29+
30+
31+
## [13.0.2] - 2023-09-26
32+
### Security
33+
- Fixed crash/infinite loop caused by linkify inline rule, #957.
34+
35+
### Fixed
36+
- Throw an error if 3rd party plugin doesn't increment `line` or `pos` counters
37+
(previously, markdown-it would likely go into infinite loop instead), #847.
38+
39+
40+
## [13.0.1] - 2022-05-03
41+
### Fixed
42+
- Bumped `linkify-it` to 4.0.1. That should fix some hangs, caused by wrong
43+
data, returned from `linkify-it`.
44+
45+
46+
## [13.0.0] - 2022-04-22
47+
### Added
48+
- Added a new token type `text_special` to store escaped characters, same as `text` but
49+
unaffected by replacement plugins (smartquotes, typographer, linkifier, etc.).
50+
- Added a new rule `text_join` in `core` ruler. Text replacement plugins may choose to
51+
insert themselves before it.
52+
53+
### Changed
54+
- `(p)` is no longer replaced with § by typographer (conflicts with ℗), #763.
55+
- `text_collapse` rule is renamed to `fragments_join`.
56+
57+
### Fixed
58+
- Smartquotes, typographic replacements and plain text links can now be escaped
59+
with backslash (e.g. `\(c)` or `google\.com` are no longer replaced).
60+
- Fixed collision of emphasis and linkifier (so `http://example.org/foo._bar_-_baz`
61+
is now a single link, not emphasized). Emails and fuzzy links are not affected by this.
62+
63+
64+
## [12.3.2] - 2022-01-08
65+
### Security
66+
- Fix possible ReDOS in newline rule. Thanks to @MakeNowJust.
67+
68+
69+
## [12.3.1] - 2022-01-07
70+
### Fixed
71+
- Fix corner case when tab prevents paragraph continuation in lists, #830.
72+
73+
74+
## [12.3.0] - 2021-12-09
75+
### Changed
76+
- `StateInline.delimiters[].jump` is removed.
77+
78+
### Fixed
79+
- Fixed quadratic complexity in pathological `***<10k stars>***a***<10k stars>***` case.
80+
81+
82+
## [12.2.0] - 2021-08-02
83+
### Added
84+
- Ordered lists: add order value to token info.
85+
86+
### Fixed
87+
- Always suffix indented code block with a newline, #799.
88+
89+
90+
## [12.1.0] - 2021-07-01
91+
### Changed
92+
- Updated CM spec compatibility to 0.30.
93+
94+
995
## [12.0.6] - 2021-04-16
1096
### Fixed
1197
- Newline in `alt` should be rendered, #775.
@@ -562,6 +648,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
562648
- Renamed presets folder (configs -> presets).
563649

564650

651+
[14.1.0]: https://github.com/markdown-it/markdown-it/compare/14.0.0...14.1.0
652+
[14.0.0]: https://github.com/markdown-it/markdown-it/compare/13.0.2...14.0.0
653+
[13.0.2]: https://github.com/markdown-it/markdown-it/compare/13.0.1...13.0.2
654+
[13.0.1]: https://github.com/markdown-it/markdown-it/compare/13.0.0...13.0.1
655+
[13.0.0]: https://github.com/markdown-it/markdown-it/compare/12.3.2...13.0.0
656+
[12.3.2]: https://github.com/markdown-it/markdown-it/compare/12.3.1...12.3.2
657+
[12.3.1]: https://github.com/markdown-it/markdown-it/compare/12.3.0...12.3.1
658+
[12.3.0]: https://github.com/markdown-it/markdown-it/compare/12.2.0...12.3.0
659+
[12.2.0]: https://github.com/markdown-it/markdown-it/compare/12.1.0...12.2.0
660+
[12.1.0]: https://github.com/markdown-it/markdown-it/compare/12.0.6...12.1.0
565661
[12.0.6]: https://github.com/markdown-it/markdown-it/compare/12.0.5...12.0.6
566662
[12.0.5]: https://github.com/markdown-it/markdown-it/compare/12.0.4...12.0.5
567663
[12.0.4]: https://github.com/markdown-it/markdown-it/compare/12.0.3...12.0.4

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### If you commit changes:
22

33
1. Make sure all tests pass.
4-
2. Run `./benchmark/benchmark.js`, make sure that performance not degraded.
4+
2. Run `./benchmark/benchmark.mjs`, make sure that performance not degraded.
55
3. DON'T include auto-generated browser files to commit.
66

77
### Other things:

Procfile

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)