@tabnas/markdown 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -10
- package/dist/ast.d.ts +31 -1
- package/dist/ast.js +26 -1
- package/dist/ast.js.map +1 -1
- package/dist/block.js +448 -8
- package/dist/block.js.map +1 -1
- package/dist/html.d.ts +9 -3
- package/dist/html.js +137 -14
- package/dist/html.js.map +1 -1
- package/dist/inline.d.ts +7 -1
- package/dist/inline.js +431 -2
- package/dist/inline.js.map +1 -1
- package/dist/markdown.d.ts +5 -2
- package/dist/markdown.js.map +1 -1
- package/dist/node.d.ts +39 -1
- package/dist/node.js +36 -0
- package/dist/node.js.map +1 -1
- package/dist/options.d.ts +9 -4
- package/dist/options.js.map +1 -1
- package/package.json +2 -1
- package/src/ast.ts +56 -2
- package/src/block.ts +495 -10
- package/src/html.ts +140 -15
- package/src/inline.ts +463 -2
- package/src/markdown.ts +7 -1
- package/src/node.ts +53 -0
- package/src/options.ts +9 -4
package/README.md
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
# @tabnas/markdown (TypeScript)
|
|
2
2
|
|
|
3
|
-
A CommonMark parser for the [Tabnas](https://github.com/tabnas/parser) engine
|
|
4
|
-
|
|
3
|
+
A CommonMark parser for the [Tabnas](https://github.com/tabnas/parser) engine.
|
|
4
|
+
|
|
5
|
+
**This parser is conformant to CommonMark 0.31.2** — all 652 examples, across all 26
|
|
6
|
+
sections of the spec suite, in both runtimes. The suite is vendored in this repository, so
|
|
7
|
+
the claim is checkable: `npm run conformance` reports 652/652, with no build step and no
|
|
8
|
+
engine installed. It runs with the GFM extensions off, which is what measuring CommonMark
|
|
9
|
+
conformance means — with `gfm: true` the extensions deliberately change nine of those
|
|
10
|
+
examples. It also implements **all five GFM extensions** — tables, task list
|
|
11
|
+
items, autolink literals, strikethrough and disallowed raw HTML — 24/24 on the vendored
|
|
12
|
+
GFM corpus, via `npm run conformance-gfm`.
|
|
13
|
+
|
|
5
14
|
This is the canonical implementation; [`go/`](../go/README.md) is a port of it.
|
|
6
15
|
|
|
7
16
|
[](https://npmjs.com/package/@tabnas/markdown)
|
|
@@ -35,13 +44,22 @@ toHtml('# Hello\n\nHello *world*') // => '<h1>Hello</h1>\n<p>Hello <em>world</em
|
|
|
35
44
|
```
|
|
36
45
|
|
|
37
46
|
**The HTML is not sanitized.** Raw HTML blocks and inline tags pass through verbatim, as
|
|
38
|
-
CommonMark specifies
|
|
39
|
-
|
|
47
|
+
CommonMark specifies. Put a sanitizer downstream of any untrusted Markdown.
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
import { toHtml } from '@tabnas/markdown'
|
|
51
|
+
|
|
52
|
+
toHtml('<img onerror="alert(1)">') // => '<img onerror="alert(1)">\n'
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
GFM's disallowed-raw-HTML filter (on with `gfm`, the default) rewrites the leading `<` of
|
|
56
|
+
nine tag names — `title`, `textarea`, `style`, `xmp`, `iframe`, `noembed`, `noframes`,
|
|
57
|
+
`script`, `plaintext` — and touches nothing else:
|
|
40
58
|
|
|
41
59
|
```js
|
|
42
60
|
import { toHtml } from '@tabnas/markdown'
|
|
43
61
|
|
|
44
|
-
toHtml('<script>alert(1)</script>') // => '
|
|
62
|
+
toHtml('<script>alert(1)</script>') // => '<script>alert(1)</script>\n'
|
|
45
63
|
```
|
|
46
64
|
|
|
47
65
|
As a Tabnas plugin, `parse()` returns the same AST as `parseDocument()`:
|
|
@@ -59,6 +77,20 @@ tn.parse('# Hello') // => { type: 'document', children: [ { type: 'heading', dep
|
|
|
59
77
|
block nodes, and can be walked or mutated and then rendered. See the
|
|
60
78
|
[reference](doc/reference.md).
|
|
61
79
|
|
|
80
|
+
GFM tables add three node types, in mdast's shape — `table`, `tableRow` and `tableCell`.
|
|
81
|
+
`align` has one entry per column, `null` where the delimiter cell had no colon; there is
|
|
82
|
+
no header flag, so the first row is the header row by convention, and every row has
|
|
83
|
+
exactly as many cells as `align` has entries.
|
|
84
|
+
|
|
85
|
+
```js
|
|
86
|
+
import { parseDocument } from '@tabnas/markdown'
|
|
87
|
+
|
|
88
|
+
const doc = parseDocument('| a | b |\n| :- | -: |\n| 1 | 2 |')
|
|
89
|
+
|
|
90
|
+
doc.children[0].align // => [ 'left', 'right' ]
|
|
91
|
+
doc.children[0].children[0].children[0] // => { type: 'tableCell', children: [ { type: 'text', value: 'a' } ] }
|
|
92
|
+
```
|
|
93
|
+
|
|
62
94
|
## Install
|
|
63
95
|
|
|
64
96
|
```bash
|
|
@@ -75,18 +107,41 @@ work with no build step and no engine installed — it stages `src/*.ts` in a te
|
|
|
75
107
|
whose `package.json` says `"type": "module"` and runs them under Node's type stripping:
|
|
76
108
|
|
|
77
109
|
```bash
|
|
78
|
-
npm run conformance # 652/652
|
|
110
|
+
npm run conformance # 652/652, all 26 sections
|
|
79
111
|
npm run conformance -- --failures
|
|
112
|
+
npm run conformance-gfm # 24/24, all five extensions
|
|
80
113
|
```
|
|
81
114
|
|
|
82
115
|
The `// =>` assertions in this repo's Markdown are executed as tests
|
|
83
116
|
(`test/doc-examples.test.ts`, and `tools/check-doc-examples.mjs` for the engine-free
|
|
84
117
|
check), so a wrong expected value is a failing test.
|
|
85
118
|
|
|
86
|
-
Options are `gfm` (default `true`) and `breaks` (default `false`). `gfm` gates
|
|
87
|
-
|
|
88
|
-
`https://`
|
|
89
|
-
implemented.
|
|
119
|
+
Options are `gfm` (default `true`) and `breaks` (default `false`). `gfm` gates five
|
|
120
|
+
extensions together — tables, strikethrough, task list items, autolink literals (bare
|
|
121
|
+
`www.` / `https://` / `a@b.co`) and the disallowed-raw-HTML filter. Footnotes are not
|
|
122
|
+
implemented. With `gfm:false` the output is plain CommonMark.
|
|
123
|
+
|
|
124
|
+
Footnotes are a GitHub product feature rather than part of the GFM spec suite, and their
|
|
125
|
+
absence is quiet: `[^1]` is a valid CommonMark link label, so a footnote authored on
|
|
126
|
+
GitHub renders as a broken link instead of raising an error.
|
|
127
|
+
|
|
128
|
+
```js
|
|
129
|
+
import { toHtml } from '@tabnas/markdown'
|
|
130
|
+
|
|
131
|
+
toHtml('Text[^1]\n\n[^1]: note') // => '<p>Text<a href="note">^1</a></p>\n'
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Nothing outside CommonMark and GFM is implemented — no math, front matter, definition
|
|
135
|
+
lists, heading attributes, admonitions, wiki links, emoji shortcodes, highlight or
|
|
136
|
+
sub/superscript. Each would need its own opt-in flag; `gfm` is not going to grow to mean
|
|
137
|
+
"everything". Note one collision: GFM's single-tilde strikethrough takes the syntax other
|
|
138
|
+
dialects use for subscript, so `H~2~O` is a deletion under the default `gfm:true`.
|
|
139
|
+
|
|
140
|
+
```js
|
|
141
|
+
import { toHtml } from '@tabnas/markdown'
|
|
142
|
+
|
|
143
|
+
toHtml('H~2~O') // => '<p>H<del>2</del>O</p>\n'
|
|
144
|
+
```
|
|
90
145
|
|
|
91
146
|
## Documentation
|
|
92
147
|
|
package/dist/ast.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { MdNode } from './node.ts';
|
|
2
|
+
import type { TableAlign } from './node.ts';
|
|
2
3
|
import type { ParserOptions } from './options.ts';
|
|
3
4
|
export type DocumentNode = {
|
|
4
5
|
type: 'document';
|
|
5
6
|
children: Block[];
|
|
6
7
|
};
|
|
7
|
-
export type Block = HeadingNode | ParagraphNode | BlockquoteNode | ListNode | ListItemNode | CodeNode | HtmlNode | ThematicBreakNode;
|
|
8
|
+
export type Block = HeadingNode | ParagraphNode | BlockquoteNode | ListNode | ListItemNode | CodeNode | HtmlNode | ThematicBreakNode | TableNode;
|
|
8
9
|
export type HeadingNode = {
|
|
9
10
|
type: 'heading';
|
|
10
11
|
depth: 1 | 2 | 3 | 4 | 5 | 6;
|
|
@@ -28,6 +29,12 @@ export type ListNode = {
|
|
|
28
29
|
export type ListItemNode = {
|
|
29
30
|
type: 'listItem';
|
|
30
31
|
spread: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* mdast's task list field: `true`/`false` for a GFM task list item
|
|
34
|
+
* (`- [x] foo`), `null` for an ordinary item — and therefore `null`
|
|
35
|
+
* everywhere when `gfm` is off.
|
|
36
|
+
*/
|
|
37
|
+
checked: boolean | null;
|
|
31
38
|
children: Block[];
|
|
32
39
|
};
|
|
33
40
|
export type CodeNode = {
|
|
@@ -43,6 +50,29 @@ export type HtmlNode = {
|
|
|
43
50
|
export type ThematicBreakNode = {
|
|
44
51
|
type: 'thematicBreak';
|
|
45
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* A GFM table, in mdast's shape.
|
|
55
|
+
*
|
|
56
|
+
* `align` has one entry per column — `null` where the delimiter row gave no
|
|
57
|
+
* colon — and every row has exactly that many cells, since the block phase
|
|
58
|
+
* pads short rows and truncates long ones.
|
|
59
|
+
*
|
|
60
|
+
* mdast has no header flag: the **first** row is the header row, by
|
|
61
|
+
* convention, and this projection preserves that ordering from the tree.
|
|
62
|
+
*/
|
|
63
|
+
export type TableNode = {
|
|
64
|
+
type: 'table';
|
|
65
|
+
align: TableAlign[];
|
|
66
|
+
children: TableRowNode[];
|
|
67
|
+
};
|
|
68
|
+
export type TableRowNode = {
|
|
69
|
+
type: 'tableRow';
|
|
70
|
+
children: TableCellNode[];
|
|
71
|
+
};
|
|
72
|
+
export type TableCellNode = {
|
|
73
|
+
type: 'tableCell';
|
|
74
|
+
children: Inline[];
|
|
75
|
+
};
|
|
46
76
|
export type Inline = TextNode | EmphasisNode | StrongNode | InlineCodeNode | LinkNode | ImageNode | BreakNode | DeleteNode | HtmlNode;
|
|
47
77
|
export type TextNode = {
|
|
48
78
|
type: 'text';
|
package/dist/ast.js
CHANGED
|
@@ -210,6 +210,25 @@ function buildBlock(node, opts, built) {
|
|
|
210
210
|
}
|
|
211
211
|
case 'html_block':
|
|
212
212
|
return { type: 'html', value: node.literal ?? '' };
|
|
213
|
+
case 'table': {
|
|
214
|
+
// Built here rather than through `built`, because a table's children are
|
|
215
|
+
// rows and cells rather than blocks — `blockChildren` never descends
|
|
216
|
+
// into one. The nesting is a fixed three levels deep, so unlike the
|
|
217
|
+
// block containers this cannot be driven past the stack by input.
|
|
218
|
+
const rows = [];
|
|
219
|
+
for (let row = node.firstChild; row; row = row.next) {
|
|
220
|
+
if ('table_row' !== row.type)
|
|
221
|
+
continue;
|
|
222
|
+
const cells = [];
|
|
223
|
+
for (let cell = row.firstChild; cell; cell = cell.next) {
|
|
224
|
+
if ('table_cell' !== cell.type)
|
|
225
|
+
continue;
|
|
226
|
+
cells.push({ type: 'tableCell', children: inlineChildren(cell, opts) });
|
|
227
|
+
}
|
|
228
|
+
rows.push({ type: 'tableRow', children: cells });
|
|
229
|
+
}
|
|
230
|
+
return { type: 'table', align: node.tableAlign ?? [], children: rows };
|
|
231
|
+
}
|
|
213
232
|
case 'list': {
|
|
214
233
|
const data = node.listData;
|
|
215
234
|
const ordered = 'ordered' === data?.type;
|
|
@@ -220,6 +239,7 @@ function buildBlock(node, opts, built) {
|
|
|
220
239
|
items.push({
|
|
221
240
|
type: 'listItem',
|
|
222
241
|
spread: itemIsSpread(child),
|
|
242
|
+
checked: child.checked,
|
|
223
243
|
children: builtChildren(child, built),
|
|
224
244
|
});
|
|
225
245
|
}
|
|
@@ -236,7 +256,12 @@ function buildBlock(node, opts, built) {
|
|
|
236
256
|
case 'item':
|
|
237
257
|
// Only reachable if an item is somehow detached from its list; a list
|
|
238
258
|
// builds its own items above.
|
|
239
|
-
return {
|
|
259
|
+
return {
|
|
260
|
+
type: 'listItem',
|
|
261
|
+
spread: itemIsSpread(node),
|
|
262
|
+
checked: node.checked,
|
|
263
|
+
children: builtChildren(node, built),
|
|
264
|
+
};
|
|
240
265
|
default:
|
|
241
266
|
return null;
|
|
242
267
|
}
|
package/dist/ast.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../src/ast.ts"],"names":[],"mappings":";AAAA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