Initial implementation of markdownlint-micromark package, micromark.mjs helpers, and tests.

This commit is contained in:
David Anson 2023-01-09 21:59:54 -08:00
parent 2e7b7b9079
commit 366a498150
14 changed files with 2885 additions and 2 deletions

View 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 -->

View 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");
});

File diff suppressed because it is too large Load diff

Binary file not shown.

View file

@ -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