mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-01-06 16:08:49 +01:00
Initial implementation of markdownlint-micromark package, micromark.mjs helpers, and tests.
This commit is contained in:
parent
2e7b7b9079
commit
366a498150
14 changed files with 2885 additions and 2 deletions
46
test/every-markdown-syntax.md
Normal file
46
test/every-markdown-syntax.md
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
Every Markdown Syntax
|
||||
=====================
|
||||
|
||||
## Level 2 ATX Heading
|
||||
|
||||
### Level 3 Closed ATX Heading ###
|
||||
|
||||
---
|
||||
|
||||
Text *emphasized* **strong** ___emphasized+strong___.
|
||||
Text `code` <strike>html</strike> <https://example.com/page>.
|
||||
Text [link](https://example.com/page) [link][] [link] ![image][link].
|
||||
|
||||
Hard
|
||||
line break
|
||||
|
||||
[link]: https://example.com/page "Title"
|
||||
|
||||
> Block quote
|
||||
> > Nested
|
||||
|
||||
- Unordered
|
||||
- List
|
||||
- Items
|
||||
Indented
|
||||
|
||||
Content
|
||||
|
||||
1. Ordered
|
||||
2. List
|
||||
1. Items
|
||||
Indented
|
||||
|
||||
Content
|
||||
|
||||
```markdown options
|
||||
Fenced code block
|
||||
```
|
||||
|
||||
Indented code block
|
||||
|
||||
<p>
|
||||
HTML block
|
||||
</p>
|
||||
|
||||
<!-- markdownlint-disable-file -->
|
||||
10
test/markdownlint-test-micromark.mjs
Normal file
10
test/markdownlint-test-micromark.mjs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import fs from "node:fs/promises";
|
||||
import test from "ava";
|
||||
import { parse } from "../lib/micromark.mjs";
|
||||
|
||||
test("parse", async(t) => {
|
||||
t.plan(1);
|
||||
const content = await fs.readFile("./test/every-markdown-syntax.md", "utf8");
|
||||
const document = parse(content);
|
||||
t.snapshot(document, "Unexpected tokens");
|
||||
});
|
||||
2634
test/snapshots/markdownlint-test-micromark.mjs.md
Normal file
2634
test/snapshots/markdownlint-test-micromark.mjs.md
Normal file
File diff suppressed because it is too large
Load diff
BIN
test/snapshots/markdownlint-test-micromark.mjs.snap
Normal file
BIN
test/snapshots/markdownlint-test-micromark.mjs.snap
Normal file
Binary file not shown.
|
|
@ -10236,6 +10236,61 @@ Generated by [AVA](https://avajs.dev).
|
|||
`,
|
||||
}
|
||||
|
||||
## every-markdown-syntax.md
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
{
|
||||
errors: [],
|
||||
fixed: `Every Markdown Syntax␊
|
||||
=====================␊
|
||||
␊
|
||||
## Level 2 ATX Heading␊
|
||||
␊
|
||||
### Level 3 Closed ATX Heading ###␊
|
||||
␊
|
||||
---␊
|
||||
␊
|
||||
Text *emphasized* **strong** ___emphasized+strong___.␊
|
||||
Text \`code\` <strike>html</strike> <https://example.com/page>.␊
|
||||
Text [link](https://example.com/page) [link][] [link] ![image][link].␊
|
||||
␊
|
||||
Hard ␊
|
||||
line break␊
|
||||
␊
|
||||
[link]: https://example.com/page "Title"␊
|
||||
␊
|
||||
> Block quote␊
|
||||
> > Nested␊
|
||||
␊
|
||||
- Unordered␊
|
||||
- List␊
|
||||
- Items␊
|
||||
Indented␊
|
||||
␊
|
||||
Content␊
|
||||
␊
|
||||
1. Ordered␊
|
||||
2. List␊
|
||||
1. Items␊
|
||||
Indented␊
|
||||
␊
|
||||
Content␊
|
||||
␊
|
||||
\`\`\`markdown options␊
|
||||
Fenced code block␊
|
||||
\`\`\`␊
|
||||
␊
|
||||
Indented code block␊
|
||||
␊
|
||||
<p>␊
|
||||
HTML block␊
|
||||
</p>␊
|
||||
␊
|
||||
<!-- markdownlint-disable-file -->␊
|
||||
`,
|
||||
}
|
||||
|
||||
## fenced-code-in-list.md
|
||||
|
||||
> Snapshot 1
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue