From 66e8516bb1a3f6f2a101e14e4afa3191fcc44267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sindre=20B=C3=B8yum?= Date: Mon, 11 Dec 2023 21:07:30 +0100 Subject: [PATCH] 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 --- CONTRIBUTING.md | 2 +- README.md | 10 +++++----- docs/architecture.md | 12 ++++++------ docs/development.md | 4 ++-- support/api_header.md | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6e2aa8c..2f75aed 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,7 @@ ### If you commit changes: 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. ### Other things: diff --git a/README.md b/README.md index a1da36f..6c79f3c 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ const md = markdownit({ linkify: false, // 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, // Double + single quotes replacement pairs, when typographer enabled, @@ -258,9 +258,9 @@ const md = markdownit({ You can find all rules in sources: -- [`parser_core.js`](lib/parser_core.js) -- [`parser_block.js`](lib/parser_block.js) -- [`parser_inline.js`](lib/parser_inline.js) +- [`parser_core.mjs`](lib/parser_core.mjs) +- [`parser_block.mjs`](lib/parser_block.mjs) +- [`parser_inline.mjs`](lib/parser_inline.mjs) ## Benchmark @@ -281,7 +281,7 @@ Sample: README.md (7774 bytes) > 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×. As you can see, `markdown-it` doesn't pay with speed for its flexibility. diff --git a/docs/architecture.md b/docs/architecture.md index 02dcee7..a96516c 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -48,7 +48,7 @@ The difference is simple: - There are special token objects, "inline containers", that have nested tokens. 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. In total, a token stream is: @@ -66,8 +66,8 @@ intoto an AST. More details about tokens: -- [`Renderer` source](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js) -- [`Token` source](https://github.com/markdown-it/markdown-it/blob/master/lib/token.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.mjs) - [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: -- [`parser_core.js`](https://github.com/markdown-it/markdown-it/blob/master/lib/parser_core.js) -- [`parser_block.js`](https://github.com/markdown-it/markdown-it/blob/master/lib/parser_block.js) -- [`parser_inline.js`](https://github.com/markdown-it/markdown-it/blob/master/lib/parser_inline.js) +- [`parser_core.mjs`](https://github.com/markdown-it/markdown-it/blob/master/lib/parser_core.mjs) +- [`parser_block.mjs`](https://github.com/markdown-it/markdown-it/blob/master/lib/parser_block.mjs) +- [`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. diff --git a/docs/development.md b/docs/development.md index 117b06c..782b75c 100644 --- a/docs/development.md +++ b/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 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. #### 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 ticket and we will consider adding it as a new charcode. diff --git a/support/api_header.md b/support/api_header.md index e7ddd29..65da378 100644 --- a/support/api_header.md +++ b/support/api_header.md @@ -88,7 +88,7 @@ const md = markdownit({ linkify: false, // 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, // Double + single quotes replacement pairs, when typographer enabled,