Browse Source

docs: replace `.js` with `.mjs` in links to files (#981)

* docs: replace `.js` with `.mjs` in links to files

* docs: replace `.js` with `.mjs` in links to files
pull/989/head
Sindre Bøyum 1 year ago
committed by GitHub
parent
commit
66e8516bb1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CONTRIBUTING.md
  2. 10
      README.md
  3. 12
      docs/architecture.md
  4. 4
      docs/development.md
  5. 2
      support/api_header.md

2
CONTRIBUTING.md

@ -1,7 +1,7 @@
### If you commit changes: ### If you commit changes:
1. Make sure all tests pass. 1. Make sure all tests pass.
2. Run `./benchmark/benchmark.js`, make sure that performance not degraded. 2. Run `./benchmark/benchmark.mjs`, make sure that performance not degraded.
3. DON'T include auto-generated browser files to commit. 3. DON'T include auto-generated browser files to commit.
### Other things: ### Other things:

10
README.md

@ -122,7 +122,7 @@ const md = markdownit({
linkify: false, linkify: false,
// Enable some language-neutral replacement + quotes beautification // Enable some language-neutral replacement + quotes beautification
// For the full list of replacements, see https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js // For the full list of replacements, see https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.mjs
typographer: false, typographer: false,
// Double + single quotes replacement pairs, when typographer enabled, // Double + single quotes replacement pairs, when typographer enabled,
@ -258,9 +258,9 @@ const md = markdownit({
You can find all rules in sources: You can find all rules in sources:
- [`parser_core.js`](lib/parser_core.js) - [`parser_core.mjs`](lib/parser_core.mjs)
- [`parser_block.js`](lib/parser_block.js) - [`parser_block.mjs`](lib/parser_block.mjs)
- [`parser_inline.js`](lib/parser_inline.js) - [`parser_inline.mjs`](lib/parser_inline.mjs)
## Benchmark ## Benchmark
@ -281,7 +281,7 @@ Sample: README.md (7774 bytes)
> marked x 1,587 ops/sec ±4.31% (93 runs sampled) > marked x 1,587 ops/sec ±4.31% (93 runs sampled)
``` ```
__Note.__ CommonMark version runs with [simplified link normalizers](https://github.com/markdown-it/markdown-it/blob/master/benchmark/implementations/current-commonmark/index.js) __Note.__ CommonMark version runs with [simplified link normalizers](https://github.com/markdown-it/markdown-it/blob/master/benchmark/implementations/current-commonmark/index.mjs)
for more "honest" compare. Difference is ≈1.5×. for more "honest" compare. Difference is ≈1.5×.
As you can see, `markdown-it` doesn't pay with speed for its flexibility. As you can see, `markdown-it` doesn't pay with speed for its flexibility.

12
docs/architecture.md

@ -48,7 +48,7 @@ The difference is simple:
- There are special token objects, "inline containers", that have nested tokens. - There are special token objects, "inline containers", that have nested tokens.
These are sequences with inline markup, such as bold, italic, text, etc. These are sequences with inline markup, such as bold, italic, text, etc.
See the [`Token`](https://github.com/markdown-it/markdown-it/blob/master/lib/token.js) class See the [`Token`](https://github.com/markdown-it/markdown-it/blob/master/lib/token.mjs) class
for details about each token's content. for details about each token's content.
In total, a token stream is: In total, a token stream is:
@ -66,8 +66,8 @@ intoto an AST.
More details about tokens: More details about tokens:
- [`Renderer` source](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js) - [`Renderer` source](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.mjs)
- [`Token` source](https://github.com/markdown-it/markdown-it/blob/master/lib/token.js) - [`Token` source](https://github.com/markdown-it/markdown-it/blob/master/lib/token.mjs)
- [Live demo](https://markdown-it.github.io/) - type your text and click the `debug` tab. - [Live demo](https://markdown-it.github.io/) - type your text and click the `debug` tab.
@ -179,8 +179,8 @@ And somewhere in between, you can apply additional transformations.
Source code for each chain can be seen in the following files: Source code for each chain can be seen in the following files:
- [`parser_core.js`](https://github.com/markdown-it/markdown-it/blob/master/lib/parser_core.js) - [`parser_core.mjs`](https://github.com/markdown-it/markdown-it/blob/master/lib/parser_core.mjs)
- [`parser_block.js`](https://github.com/markdown-it/markdown-it/blob/master/lib/parser_block.js) - [`parser_block.mjs`](https://github.com/markdown-it/markdown-it/blob/master/lib/parser_block.mjs)
- [`parser_inline.js`](https://github.com/markdown-it/markdown-it/blob/master/lib/parser_inline.js) - [`parser_inline.mjs`](https://github.com/markdown-it/markdown-it/blob/master/lib/parser_inline.mjs)
Also, you can change output directly in a [`Renderer`](https://markdown-it.github.io/markdown-it/#Renderer) for many simple cases. Also, you can change output directly in a [`Renderer`](https://markdown-it.github.io/markdown-it/#Renderer) for many simple cases.

4
docs/development.md

@ -64,14 +64,14 @@ in a more convenient way.
The right sequence is to split text to several tokens and add link tokens in between. The right sequence is to split text to several tokens and add link tokens in between.
The result will be: `text` + `link_open` + `text` + `link_close` + `text`. The result will be: `text` + `link_open` + `text` + `link_close` + `text`.
See implementations of [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js) and [emoji](https://github.com/markdown-it/markdown-it-emoji/blob/master/lib/replace.js) - those do text token splits. See implementations of [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.mjs) and [emoji](https://github.com/markdown-it/markdown-it-emoji/blob/master/lib/replace.mjs) - those do text token splits.
__Note.__ Don't try to replace text with HTML markup! That's not secure. __Note.__ Don't try to replace text with HTML markup! That's not secure.
#### Why my inline rule is not executed? #### Why my inline rule is not executed?
The inline parser skips pieces of texts to optimize speed. It stops only on [a small set of chars](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_inline/text.js), which can be tokens. We did not made this list extensible for performance reasons too. The inline parser skips pieces of texts to optimize speed. It stops only on [a small set of chars](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_inline/text.mjs), which can be tokens. We did not made this list extensible for performance reasons too.
If you are absolutely sure that something important is missing there - create a If you are absolutely sure that something important is missing there - create a
ticket and we will consider adding it as a new charcode. ticket and we will consider adding it as a new charcode.

2
support/api_header.md

@ -88,7 +88,7 @@ const md = markdownit({
linkify: false, linkify: false,
// Enable some language-neutral replacement + quotes beautification // Enable some language-neutral replacement + quotes beautification
// For the full list of replacements, see https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js // For the full list of replacements, see https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.mjs
typographer: false, typographer: false,
// Double + single quotes replacement pairs, when typographer enabled, // Double + single quotes replacement pairs, when typographer enabled,

Loading…
Cancel
Save