@depup/micromark-extension-gfm 3.0.0-depup.52
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 +37 -0
- package/changes.json +34 -0
- package/index.d.ts +28 -0
- package/index.js +69 -0
- package/license +22 -0
- package/package.json +151 -0
- package/readme.md +433 -0
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# @depup/micromark-extension-gfm
|
|
2
|
+
|
|
3
|
+
> Dependency-bumped version of [micromark-extension-gfm](https://www.npmjs.com/package/micromark-extension-gfm)
|
|
4
|
+
|
|
5
|
+
Generated by [DepUp](https://github.com/depup/npm) -- all production
|
|
6
|
+
dependencies bumped to latest versions.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @depup/micromark-extension-gfm
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
| Field | Value |
|
|
15
|
+
|-------|-------|
|
|
16
|
+
| Original | [micromark-extension-gfm](https://www.npmjs.com/package/micromark-extension-gfm) @ 3.0.0 |
|
|
17
|
+
| Processed | 2026-07-21 |
|
|
18
|
+
| Smoke test | passed |
|
|
19
|
+
| Deps updated | 7 |
|
|
20
|
+
|
|
21
|
+
## Dependency Changes
|
|
22
|
+
|
|
23
|
+
| Dependency | From | To |
|
|
24
|
+
|------------|------|-----|
|
|
25
|
+
| micromark-extension-gfm-autolink-literal | ^2.0.0 | ^2.1.0 |
|
|
26
|
+
| micromark-extension-gfm-footnote | ^2.0.0 | ^2.1.0 |
|
|
27
|
+
| micromark-extension-gfm-strikethrough | ^2.0.0 | ^2.1.0 |
|
|
28
|
+
| micromark-extension-gfm-table | ^2.0.0 | ^2.1.1 |
|
|
29
|
+
| micromark-extension-gfm-task-list-item | ^2.0.0 | ^2.1.0 |
|
|
30
|
+
| micromark-util-combine-extensions | ^2.0.0 | ^2.0.1 |
|
|
31
|
+
| micromark-util-types | ^2.0.0 | ^2.0.2 |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
Source: https://github.com/depup/npm | Original: https://www.npmjs.com/package/micromark-extension-gfm
|
|
36
|
+
|
|
37
|
+
License inherited from the original package.
|
package/changes.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"bumped": {
|
|
3
|
+
"micromark-extension-gfm-autolink-literal": {
|
|
4
|
+
"from": "^2.0.0",
|
|
5
|
+
"to": "^2.1.0"
|
|
6
|
+
},
|
|
7
|
+
"micromark-extension-gfm-footnote": {
|
|
8
|
+
"from": "^2.0.0",
|
|
9
|
+
"to": "^2.1.0"
|
|
10
|
+
},
|
|
11
|
+
"micromark-extension-gfm-strikethrough": {
|
|
12
|
+
"from": "^2.0.0",
|
|
13
|
+
"to": "^2.1.0"
|
|
14
|
+
},
|
|
15
|
+
"micromark-extension-gfm-table": {
|
|
16
|
+
"from": "^2.0.0",
|
|
17
|
+
"to": "^2.1.1"
|
|
18
|
+
},
|
|
19
|
+
"micromark-extension-gfm-task-list-item": {
|
|
20
|
+
"from": "^2.0.0",
|
|
21
|
+
"to": "^2.1.0"
|
|
22
|
+
},
|
|
23
|
+
"micromark-util-combine-extensions": {
|
|
24
|
+
"from": "^2.0.0",
|
|
25
|
+
"to": "^2.0.1"
|
|
26
|
+
},
|
|
27
|
+
"micromark-util-types": {
|
|
28
|
+
"from": "^2.0.0",
|
|
29
|
+
"to": "^2.0.2"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"timestamp": "2026-07-21T17:27:28.093Z",
|
|
33
|
+
"totalUpdated": 7
|
|
34
|
+
}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create an extension for `micromark` to enable GFM syntax.
|
|
3
|
+
*
|
|
4
|
+
* @param {Options | null | undefined} [options]
|
|
5
|
+
* Configuration (optional).
|
|
6
|
+
*
|
|
7
|
+
* Passed to `micromark-extens-gfm-strikethrough`.
|
|
8
|
+
* @returns {Extension}
|
|
9
|
+
* Extension for `micromark` that can be passed in `extensions` to enable GFM
|
|
10
|
+
* syntax.
|
|
11
|
+
*/
|
|
12
|
+
export function gfm(options?: Options | null | undefined): Extension
|
|
13
|
+
/**
|
|
14
|
+
* Create an extension for `micromark` to support GFM when serializing to HTML.
|
|
15
|
+
*
|
|
16
|
+
* @param {HtmlOptions | null | undefined} [options]
|
|
17
|
+
* Configuration (optional).
|
|
18
|
+
*
|
|
19
|
+
* Passed to `micromark-extens-gfm-footnote`.
|
|
20
|
+
* @returns {HtmlExtension}
|
|
21
|
+
* Extension for `micromark` that can be passed in `htmlExtensions` to
|
|
22
|
+
* support GFM when serializing to HTML.
|
|
23
|
+
*/
|
|
24
|
+
export function gfmHtml(options?: HtmlOptions | null | undefined): HtmlExtension
|
|
25
|
+
export type HtmlOptions = import('micromark-extension-gfm-footnote').HtmlOptions
|
|
26
|
+
export type Options = import('micromark-extension-gfm-strikethrough').Options
|
|
27
|
+
export type Extension = import('micromark-util-types').Extension
|
|
28
|
+
export type HtmlExtension = import('micromark-util-types').HtmlExtension
|
package/index.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('micromark-extension-gfm-footnote').HtmlOptions} HtmlOptions
|
|
3
|
+
* @typedef {import('micromark-extension-gfm-strikethrough').Options} Options
|
|
4
|
+
* @typedef {import('micromark-util-types').Extension} Extension
|
|
5
|
+
* @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
combineExtensions,
|
|
10
|
+
combineHtmlExtensions
|
|
11
|
+
} from 'micromark-util-combine-extensions'
|
|
12
|
+
import {
|
|
13
|
+
gfmAutolinkLiteral,
|
|
14
|
+
gfmAutolinkLiteralHtml
|
|
15
|
+
} from 'micromark-extension-gfm-autolink-literal'
|
|
16
|
+
import {gfmFootnote, gfmFootnoteHtml} from 'micromark-extension-gfm-footnote'
|
|
17
|
+
import {
|
|
18
|
+
gfmStrikethrough,
|
|
19
|
+
gfmStrikethroughHtml
|
|
20
|
+
} from 'micromark-extension-gfm-strikethrough'
|
|
21
|
+
import {gfmTable, gfmTableHtml} from 'micromark-extension-gfm-table'
|
|
22
|
+
import {gfmTagfilterHtml} from 'micromark-extension-gfm-tagfilter'
|
|
23
|
+
import {
|
|
24
|
+
gfmTaskListItem,
|
|
25
|
+
gfmTaskListItemHtml
|
|
26
|
+
} from 'micromark-extension-gfm-task-list-item'
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Create an extension for `micromark` to enable GFM syntax.
|
|
30
|
+
*
|
|
31
|
+
* @param {Options | null | undefined} [options]
|
|
32
|
+
* Configuration (optional).
|
|
33
|
+
*
|
|
34
|
+
* Passed to `micromark-extens-gfm-strikethrough`.
|
|
35
|
+
* @returns {Extension}
|
|
36
|
+
* Extension for `micromark` that can be passed in `extensions` to enable GFM
|
|
37
|
+
* syntax.
|
|
38
|
+
*/
|
|
39
|
+
export function gfm(options) {
|
|
40
|
+
return combineExtensions([
|
|
41
|
+
gfmAutolinkLiteral(),
|
|
42
|
+
gfmFootnote(),
|
|
43
|
+
gfmStrikethrough(options),
|
|
44
|
+
gfmTable(),
|
|
45
|
+
gfmTaskListItem()
|
|
46
|
+
])
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Create an extension for `micromark` to support GFM when serializing to HTML.
|
|
51
|
+
*
|
|
52
|
+
* @param {HtmlOptions | null | undefined} [options]
|
|
53
|
+
* Configuration (optional).
|
|
54
|
+
*
|
|
55
|
+
* Passed to `micromark-extens-gfm-footnote`.
|
|
56
|
+
* @returns {HtmlExtension}
|
|
57
|
+
* Extension for `micromark` that can be passed in `htmlExtensions` to
|
|
58
|
+
* support GFM when serializing to HTML.
|
|
59
|
+
*/
|
|
60
|
+
export function gfmHtml(options) {
|
|
61
|
+
return combineHtmlExtensions([
|
|
62
|
+
gfmAutolinkLiteralHtml(),
|
|
63
|
+
gfmFootnoteHtml(options),
|
|
64
|
+
gfmStrikethroughHtml(),
|
|
65
|
+
gfmTableHtml(),
|
|
66
|
+
gfmTagfilterHtml(),
|
|
67
|
+
gfmTaskListItemHtml()
|
|
68
|
+
])
|
|
69
|
+
}
|
package/license
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Titus Wormer <tituswormer@gmail.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
'Software'), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
20
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/package.json
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@depup/micromark-extension-gfm",
|
|
3
|
+
"version": "3.0.0-depup.52",
|
|
4
|
+
"description": "micromark extension to support GFM (GitHub Flavored Markdown) (with updated dependencies)",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"micromark-extension-gfm",
|
|
8
|
+
"depup",
|
|
9
|
+
"updated-dependencies",
|
|
10
|
+
"security",
|
|
11
|
+
"latest",
|
|
12
|
+
"patched",
|
|
13
|
+
"micromark",
|
|
14
|
+
"micromark-extension",
|
|
15
|
+
"table",
|
|
16
|
+
"strikethrough",
|
|
17
|
+
"tasklist",
|
|
18
|
+
"autolink",
|
|
19
|
+
"footnote",
|
|
20
|
+
"tagfilter",
|
|
21
|
+
"github",
|
|
22
|
+
"gfm",
|
|
23
|
+
"markdown",
|
|
24
|
+
"unified"
|
|
25
|
+
],
|
|
26
|
+
"repository": "micromark/micromark-extension-gfm",
|
|
27
|
+
"bugs": "https://github.com/micromark/micromark-extension-gfm/issues",
|
|
28
|
+
"funding": {
|
|
29
|
+
"type": "opencollective",
|
|
30
|
+
"url": "https://opencollective.com/unified"
|
|
31
|
+
},
|
|
32
|
+
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
|
|
33
|
+
"contributors": [
|
|
34
|
+
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
|
|
35
|
+
],
|
|
36
|
+
"sideEffects": false,
|
|
37
|
+
"type": "module",
|
|
38
|
+
"exports": "./index.js",
|
|
39
|
+
"files": [
|
|
40
|
+
"index.d.ts",
|
|
41
|
+
"index.js",
|
|
42
|
+
"changes.json",
|
|
43
|
+
"README.md"
|
|
44
|
+
],
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"micromark-extension-gfm-autolink-literal": "^2.1.0",
|
|
47
|
+
"micromark-extension-gfm-footnote": "^2.1.0",
|
|
48
|
+
"micromark-extension-gfm-strikethrough": "^2.1.0",
|
|
49
|
+
"micromark-extension-gfm-table": "^2.1.1",
|
|
50
|
+
"micromark-extension-gfm-tagfilter": "^2.0.0",
|
|
51
|
+
"micromark-extension-gfm-task-list-item": "^2.1.0",
|
|
52
|
+
"micromark-util-combine-extensions": "^2.0.1",
|
|
53
|
+
"micromark-util-types": "^2.0.2"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@types/node": "^20.0.0",
|
|
57
|
+
"c8": "^8.0.0",
|
|
58
|
+
"create-gfm-fixtures": "^1.0.0",
|
|
59
|
+
"hast-util-from-html": "^1.0.0",
|
|
60
|
+
"hast-util-select": "^5.0.0",
|
|
61
|
+
"hast-util-to-text": "^3.0.0",
|
|
62
|
+
"micromark": "^4.0.0",
|
|
63
|
+
"prettier": "^2.0.0",
|
|
64
|
+
"rehype": "^12.0.0",
|
|
65
|
+
"rehype-sort-attributes": "^4.0.0",
|
|
66
|
+
"remark-cli": "^11.0.0",
|
|
67
|
+
"remark-preset-wooorm": "^9.0.0",
|
|
68
|
+
"type-coverage": "^2.0.0",
|
|
69
|
+
"typescript": "^5.0.0",
|
|
70
|
+
"undici": "^5.0.0",
|
|
71
|
+
"xo": "^0.54.0"
|
|
72
|
+
},
|
|
73
|
+
"scripts": {
|
|
74
|
+
"build": "tsc --build --clean && tsc --build && type-coverage",
|
|
75
|
+
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
|
|
76
|
+
"test-api-prod": "node --conditions production test/index.js",
|
|
77
|
+
"test-api-dev": "node --conditions development test/index.js",
|
|
78
|
+
"test-api": "npm run test-api-dev && npm run test-api-prod",
|
|
79
|
+
"test-coverage": "c8 --100 --reporter lcov npm run test-api",
|
|
80
|
+
"test": "npm run build && npm run format && npm run test-coverage"
|
|
81
|
+
},
|
|
82
|
+
"prettier": {
|
|
83
|
+
"bracketSpacing": false,
|
|
84
|
+
"semi": false,
|
|
85
|
+
"singleQuote": true,
|
|
86
|
+
"tabWidth": 2,
|
|
87
|
+
"trailingComma": "none",
|
|
88
|
+
"useTabs": false
|
|
89
|
+
},
|
|
90
|
+
"remarkConfig": {
|
|
91
|
+
"plugins": [
|
|
92
|
+
"remark-preset-wooorm"
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
"typeCoverage": {
|
|
96
|
+
"atLeast": 100,
|
|
97
|
+
"detail": true,
|
|
98
|
+
"ignoreCatch": true,
|
|
99
|
+
"strict": true
|
|
100
|
+
},
|
|
101
|
+
"xo": {
|
|
102
|
+
"prettier": true,
|
|
103
|
+
"overrides": [
|
|
104
|
+
{
|
|
105
|
+
"files": [
|
|
106
|
+
"{test,script}/**/*.js"
|
|
107
|
+
],
|
|
108
|
+
"rules": {
|
|
109
|
+
"no-await-in-loop": "off"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
"depup": {
|
|
115
|
+
"changes": {
|
|
116
|
+
"micromark-extension-gfm-autolink-literal": {
|
|
117
|
+
"from": "^2.0.0",
|
|
118
|
+
"to": "^2.1.0"
|
|
119
|
+
},
|
|
120
|
+
"micromark-extension-gfm-footnote": {
|
|
121
|
+
"from": "^2.0.0",
|
|
122
|
+
"to": "^2.1.0"
|
|
123
|
+
},
|
|
124
|
+
"micromark-extension-gfm-strikethrough": {
|
|
125
|
+
"from": "^2.0.0",
|
|
126
|
+
"to": "^2.1.0"
|
|
127
|
+
},
|
|
128
|
+
"micromark-extension-gfm-table": {
|
|
129
|
+
"from": "^2.0.0",
|
|
130
|
+
"to": "^2.1.1"
|
|
131
|
+
},
|
|
132
|
+
"micromark-extension-gfm-task-list-item": {
|
|
133
|
+
"from": "^2.0.0",
|
|
134
|
+
"to": "^2.1.0"
|
|
135
|
+
},
|
|
136
|
+
"micromark-util-combine-extensions": {
|
|
137
|
+
"from": "^2.0.0",
|
|
138
|
+
"to": "^2.0.1"
|
|
139
|
+
},
|
|
140
|
+
"micromark-util-types": {
|
|
141
|
+
"from": "^2.0.0",
|
|
142
|
+
"to": "^2.0.2"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"depsUpdated": 7,
|
|
146
|
+
"originalPackage": "micromark-extension-gfm",
|
|
147
|
+
"originalVersion": "3.0.0",
|
|
148
|
+
"processedAt": "2026-07-21T17:27:42.785Z",
|
|
149
|
+
"smokeTest": "passed"
|
|
150
|
+
}
|
|
151
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
# micromark-extension-gfm
|
|
2
|
+
|
|
3
|
+
[![Build][build-badge]][build]
|
|
4
|
+
[![Coverage][coverage-badge]][coverage]
|
|
5
|
+
[![Downloads][downloads-badge]][downloads]
|
|
6
|
+
[![Size][size-badge]][size]
|
|
7
|
+
[![Sponsors][sponsors-badge]][collective]
|
|
8
|
+
[![Backers][backers-badge]][collective]
|
|
9
|
+
[![Chat][chat-badge]][chat]
|
|
10
|
+
|
|
11
|
+
[micromark][] extensions to support [GitHub flavored markdown][gfm] (GFM).
|
|
12
|
+
|
|
13
|
+
## Contents
|
|
14
|
+
|
|
15
|
+
* [What is this?](#what-is-this)
|
|
16
|
+
* [When to use this](#when-to-use-this)
|
|
17
|
+
* [Install](#install)
|
|
18
|
+
* [Use](#use)
|
|
19
|
+
* [API](#api)
|
|
20
|
+
* [`gfm(options?)`](#gfmoptions)
|
|
21
|
+
* [`gfmHtml(options?)`](#gfmhtmloptions)
|
|
22
|
+
* [`Options`](#options)
|
|
23
|
+
* [`HtmlOptions`](#htmloptions)
|
|
24
|
+
* [Bugs](#bugs)
|
|
25
|
+
* [Authoring](#authoring)
|
|
26
|
+
* [HTML](#html)
|
|
27
|
+
* [CSS](#css)
|
|
28
|
+
* [Syntax](#syntax)
|
|
29
|
+
* [Types](#types)
|
|
30
|
+
* [Compatibility](#compatibility)
|
|
31
|
+
* [Security](#security)
|
|
32
|
+
* [Contribute](#contribute)
|
|
33
|
+
* [License](#license)
|
|
34
|
+
|
|
35
|
+
## What is this?
|
|
36
|
+
|
|
37
|
+
This package contains extensions that add support for all features enabled by
|
|
38
|
+
GFM to [`micromark`][micromark].
|
|
39
|
+
It supports autolink literals, footnotes, strikethrough, tables, tagfilter, and
|
|
40
|
+
tasklists.
|
|
41
|
+
|
|
42
|
+
## When to use this
|
|
43
|
+
|
|
44
|
+
This project is useful when you want to support GFM in markdown.
|
|
45
|
+
|
|
46
|
+
You can use these extensions when you are working with [`micromark`][micromark].
|
|
47
|
+
Alternatively, you can also use the underlying features separately:
|
|
48
|
+
|
|
49
|
+
* [`micromark-extension-gfm-autolink-literal`][gfm-autolink-literal]
|
|
50
|
+
— support GFM [autolink literals][]
|
|
51
|
+
* [`micromark-extension-gfm-footnote`][gfm-footnote]
|
|
52
|
+
— support GFM [footnotes][]
|
|
53
|
+
* [`micromark-extension-gfm-strikethrough`][gfm-strikethrough]
|
|
54
|
+
— support GFM [strikethrough][]
|
|
55
|
+
* [`micromark-extension-gfm-table`][gfm-table]
|
|
56
|
+
— support GFM [tables][]
|
|
57
|
+
* [`micromark-extension-gfm-tagfilter`][gfm-tagfilter]
|
|
58
|
+
— support GFM [tagfilter][]
|
|
59
|
+
* [`micromark-extension-gfm-task-list-item`][gfm-task-list-item]
|
|
60
|
+
— support GFM [tasklists][]
|
|
61
|
+
|
|
62
|
+
When you need a syntax tree, combine this package with
|
|
63
|
+
[`mdast-util-gfm`][mdast-util-gfm].
|
|
64
|
+
|
|
65
|
+
All these packages are used in [`remark-gfm`][remark-gfm], which focusses on
|
|
66
|
+
making it easier to transform content by abstracting these internals away.
|
|
67
|
+
|
|
68
|
+
## Install
|
|
69
|
+
|
|
70
|
+
This package is [ESM only][esm].
|
|
71
|
+
In Node.js (version 16+), install with [npm][]:
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
npm install micromark-extension-gfm
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
In Deno with [`esm.sh`][esmsh]:
|
|
78
|
+
|
|
79
|
+
```js
|
|
80
|
+
import {gfm, gfmHtml} from 'https://esm.sh/micromark-extension-gfm@3'
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
In browsers with [`esm.sh`][esmsh]:
|
|
84
|
+
|
|
85
|
+
```html
|
|
86
|
+
<script type="module">
|
|
87
|
+
import {gfm, gfmHtml} from 'https://esm.sh/micromark-extension-gfm@3?bundle'
|
|
88
|
+
</script>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Use
|
|
92
|
+
|
|
93
|
+
Say our document `example.md` contains:
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
# GFM
|
|
97
|
+
|
|
98
|
+
## Autolink literals
|
|
99
|
+
|
|
100
|
+
www.example.com, https://example.com, and contact@example.com.
|
|
101
|
+
|
|
102
|
+
## Footnote
|
|
103
|
+
|
|
104
|
+
A note[^1]
|
|
105
|
+
|
|
106
|
+
[^1]: Big note.
|
|
107
|
+
|
|
108
|
+
## Strikethrough
|
|
109
|
+
|
|
110
|
+
~one~ or ~~two~~ tildes.
|
|
111
|
+
|
|
112
|
+
## Table
|
|
113
|
+
|
|
114
|
+
| a | b | c | d |
|
|
115
|
+
| - | :- | -: | :-: |
|
|
116
|
+
|
|
117
|
+
## Tag filter
|
|
118
|
+
|
|
119
|
+
<plaintext>
|
|
120
|
+
|
|
121
|
+
## Tasklist
|
|
122
|
+
|
|
123
|
+
* [ ] to do
|
|
124
|
+
* [x] done
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
…and our module `example.js` looks as follows:
|
|
128
|
+
|
|
129
|
+
```js
|
|
130
|
+
import fs from 'node:fs/promises'
|
|
131
|
+
import {micromark} from 'micromark'
|
|
132
|
+
import {gfm, gfmHtml} from 'micromark-extension-gfm'
|
|
133
|
+
|
|
134
|
+
const output = micromark(await fs.readFile('example.md'), {
|
|
135
|
+
allowDangerousHtml: true,
|
|
136
|
+
extensions: [gfm()],
|
|
137
|
+
htmlExtensions: [gfmHtml()]
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
console.log(output)
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
…now running `node example.js` yields:
|
|
144
|
+
|
|
145
|
+
```html
|
|
146
|
+
<h1>GFM</h1>
|
|
147
|
+
<h2>Autolink literals</h2>
|
|
148
|
+
<p><a href="http://www.example.com">www.example.com</a>, <a href="https://example.com">https://example.com</a>, and <a href="mailto:contact@example.com">contact@example.com</a>.</p>
|
|
149
|
+
<h2>Footnote</h2>
|
|
150
|
+
<p>A note<sup><a href="#user-content-fn-1" id="user-content-fnref-1" data-footnote-ref="" aria-describedby="footnote-label">1</a></sup></p>
|
|
151
|
+
<h2>Strikethrough</h2>
|
|
152
|
+
<p><del>one</del> or <del>two</del> tildes.</p>
|
|
153
|
+
<h2>Table</h2>
|
|
154
|
+
<table>
|
|
155
|
+
<thead>
|
|
156
|
+
<tr>
|
|
157
|
+
<th>a</th>
|
|
158
|
+
<th align="left">b</th>
|
|
159
|
+
<th align="right">c</th>
|
|
160
|
+
<th align="center">d</th>
|
|
161
|
+
</tr>
|
|
162
|
+
</thead>
|
|
163
|
+
</table>
|
|
164
|
+
<h2>Tag filter</h2>
|
|
165
|
+
<plaintext>
|
|
166
|
+
<h2>Tasklist</h2>
|
|
167
|
+
<ul>
|
|
168
|
+
<li><input type="checkbox" disabled="" /> to do</li>
|
|
169
|
+
<li><input type="checkbox" disabled="" checked="" /> done</li>
|
|
170
|
+
</ul>
|
|
171
|
+
<section data-footnotes="" class="footnotes"><h2 id="footnote-label" class="sr-only">Footnotes</h2>
|
|
172
|
+
<ol>
|
|
173
|
+
<li id="user-content-fn-1">
|
|
174
|
+
<p>Big note. <a href="#user-content-fnref-1" data-footnote-backref="" class="data-footnote-backref" aria-label="Back to content">↩</a></p>
|
|
175
|
+
</li>
|
|
176
|
+
</ol>
|
|
177
|
+
</section>
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## API
|
|
181
|
+
|
|
182
|
+
This package exports the identifiers [`gfm`][api-gfm] and
|
|
183
|
+
[`gfmHtml`][api-gfm-html].
|
|
184
|
+
There is no default export.
|
|
185
|
+
|
|
186
|
+
The separate extensions support the [`development` condition][development].
|
|
187
|
+
Run `node --conditions development module.js` to get instrumented dev code.
|
|
188
|
+
Without this condition, production code is loaded.
|
|
189
|
+
|
|
190
|
+
### `gfm(options?)`
|
|
191
|
+
|
|
192
|
+
Create an extension for `micromark` to enable GFM syntax.
|
|
193
|
+
|
|
194
|
+
###### Parameters
|
|
195
|
+
|
|
196
|
+
* `options` ([`Options`][api-options], optional)
|
|
197
|
+
— configuration; passed to
|
|
198
|
+
[`micromark-extens-gfm-strikethrough`][gfm-strikethrough-options]
|
|
199
|
+
|
|
200
|
+
###### Returns
|
|
201
|
+
|
|
202
|
+
Extension for `micromark` that can be passed in `extensions` to enable GFM
|
|
203
|
+
syntax ([`Extension`][micromark-extension]).
|
|
204
|
+
|
|
205
|
+
### `gfmHtml(options?)`
|
|
206
|
+
|
|
207
|
+
Create an extension for `micromark` to support GFM when serializing to HTML.
|
|
208
|
+
|
|
209
|
+
###### Parameters
|
|
210
|
+
|
|
211
|
+
* `options` ([`HtmlOptions`][api-html-options], optional)
|
|
212
|
+
— configuration; passed to
|
|
213
|
+
[`micromark-extens-gfm-footnote`][gfm-footnote-html-options]
|
|
214
|
+
|
|
215
|
+
###### Returns
|
|
216
|
+
|
|
217
|
+
Extension for `micromark` that can be passed in `htmlExtensions` to support GFM
|
|
218
|
+
when serializing to HTML ([`HtmlExtension`][micromark-html-extension]).
|
|
219
|
+
|
|
220
|
+
### `Options`
|
|
221
|
+
|
|
222
|
+
Configuration for syntax (TypeScript type).
|
|
223
|
+
|
|
224
|
+
###### Type
|
|
225
|
+
|
|
226
|
+
```ts
|
|
227
|
+
export type {Options} from 'micromark-extension-gfm-strikethrough'
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
[See `Options`][gfm-strikethrough-options].
|
|
231
|
+
|
|
232
|
+
### `HtmlOptions`
|
|
233
|
+
|
|
234
|
+
Configuration for HTML (TypeScript type).
|
|
235
|
+
|
|
236
|
+
###### Type
|
|
237
|
+
|
|
238
|
+
```ts
|
|
239
|
+
export type {HtmlOptions} from 'micromark-extension-gfm-footnote'
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
[See `HtmlOptions`][gfm-footnote-html-options].
|
|
243
|
+
|
|
244
|
+
## Bugs
|
|
245
|
+
|
|
246
|
+
For bugs present in GFM but not here, or other peculiarities that are
|
|
247
|
+
supported, see each corresponding readme:
|
|
248
|
+
|
|
249
|
+
* [autolink literal](https://github.com/micromark/micromark-extension-gfm-autolink-literal#bugs)
|
|
250
|
+
* [footnote](https://github.com/micromark/micromark-extension-gfm-footnote#bugs)
|
|
251
|
+
* strikethrough: n/a
|
|
252
|
+
* [table](https://github.com/micromark/micromark-extension-gfm-table#bugs)
|
|
253
|
+
* tagfilter: n/a
|
|
254
|
+
* tasklists: n/a
|
|
255
|
+
|
|
256
|
+
## Authoring
|
|
257
|
+
|
|
258
|
+
For recommendations on how to author GFM, see each corresponding readme:
|
|
259
|
+
|
|
260
|
+
* [autolink literal](https://github.com/micromark/micromark-extension-gfm-autolink-literal#authoring)
|
|
261
|
+
* [footnote](https://github.com/micromark/micromark-extension-gfm-footnote#authoring)
|
|
262
|
+
* [strikethrough](https://github.com/micromark/micromark-extension-gfm-strikethrough#authoring)
|
|
263
|
+
* [table](https://github.com/micromark/micromark-extension-gfm-table#authoring)
|
|
264
|
+
* tagfilter: n/a
|
|
265
|
+
* [tasklists](https://github.com/micromark/micromark-extension-gfm-task-list-item#authoring)
|
|
266
|
+
|
|
267
|
+
## HTML
|
|
268
|
+
|
|
269
|
+
For info on what HTML features GFM relates to, see each corresponding readme:
|
|
270
|
+
|
|
271
|
+
* [autolink literal](https://github.com/micromark/micromark-extension-gfm-autolink-literal#html)
|
|
272
|
+
* [footnote](https://github.com/micromark/micromark-extension-gfm-footnote#html)
|
|
273
|
+
* [strikethrough](https://github.com/micromark/micromark-extension-gfm-strikethrough#html)
|
|
274
|
+
* [table](https://github.com/micromark/micromark-extension-gfm-table#html)
|
|
275
|
+
* [tagfilter](https://github.com/micromark/micromark-extension-gfm-tagfilter#html)
|
|
276
|
+
* [tasklists](https://github.com/micromark/micromark-extension-gfm-task-list-item#html)
|
|
277
|
+
|
|
278
|
+
## CSS
|
|
279
|
+
|
|
280
|
+
For info on how GitHub styles these features, see each corresponding readme:
|
|
281
|
+
|
|
282
|
+
* [autolink literal](https://github.com/micromark/micromark-extension-gfm-autolink-literal#css)
|
|
283
|
+
* [footnote](https://github.com/micromark/micromark-extension-gfm-footnote#css)
|
|
284
|
+
* [strikethrough](https://github.com/micromark/micromark-extension-gfm-strikethrough#css)
|
|
285
|
+
* [table](https://github.com/micromark/micromark-extension-gfm-table#css)
|
|
286
|
+
* tagfilter: n/a
|
|
287
|
+
* [tasklists](https://github.com/micromark/micromark-extension-gfm-task-list-item#css)
|
|
288
|
+
|
|
289
|
+
## Syntax
|
|
290
|
+
|
|
291
|
+
For info on the syntax of these features, see each corresponding readme:
|
|
292
|
+
|
|
293
|
+
* [autolink literal](https://github.com/micromark/micromark-extension-gfm-autolink-literal#syntax)
|
|
294
|
+
* [footnote](https://github.com/micromark/micromark-extension-gfm-footnote#syntax)
|
|
295
|
+
* [strikethrough](https://github.com/micromark/micromark-extension-gfm-strikethrough#syntax)
|
|
296
|
+
* [table](https://github.com/micromark/micromark-extension-gfm-table#syntax)
|
|
297
|
+
* tagfilter: n/a
|
|
298
|
+
* [tasklists](https://github.com/micromark/micromark-extension-gfm-task-list-item#syntax)
|
|
299
|
+
|
|
300
|
+
## Types
|
|
301
|
+
|
|
302
|
+
This package is fully typed with [TypeScript][].
|
|
303
|
+
It exports the additional types [`HtmlOptions`][api-html-options] and
|
|
304
|
+
[`Options`][api-options].
|
|
305
|
+
|
|
306
|
+
## Compatibility
|
|
307
|
+
|
|
308
|
+
Projects maintained by the unified collective are compatible with maintained
|
|
309
|
+
versions of Node.js.
|
|
310
|
+
|
|
311
|
+
When we cut a new major release, we drop support for unmaintained versions of
|
|
312
|
+
Node.
|
|
313
|
+
This means we try to keep the current release line,
|
|
314
|
+
`micromark-extension-gfm@^3`, compatible with Node.js 16.
|
|
315
|
+
|
|
316
|
+
This package works with `micromark` version `3` and later.
|
|
317
|
+
|
|
318
|
+
## Security
|
|
319
|
+
|
|
320
|
+
This package is safe.
|
|
321
|
+
Setting `clobberPrefix = ''` is dangerous, it opens you up to DOM clobbering.
|
|
322
|
+
The `labelTagName` and `labelAttributes` options are unsafe when used with user
|
|
323
|
+
content, they allow defining arbitrary HTML.
|
|
324
|
+
|
|
325
|
+
## Contribute
|
|
326
|
+
|
|
327
|
+
See [`contributing.md` in `micromark/.github`][contributing] for ways to get
|
|
328
|
+
started.
|
|
329
|
+
See [`support.md`][support] for ways to get help.
|
|
330
|
+
|
|
331
|
+
This project has a [code of conduct][coc].
|
|
332
|
+
By interacting with this repository, organization, or community you agree to
|
|
333
|
+
abide by its terms.
|
|
334
|
+
|
|
335
|
+
## License
|
|
336
|
+
|
|
337
|
+
[MIT][license] © [Titus Wormer][author]
|
|
338
|
+
|
|
339
|
+
<!-- Definitions -->
|
|
340
|
+
|
|
341
|
+
[build-badge]: https://github.com/micromark/micromark-extension-gfm/workflows/main/badge.svg
|
|
342
|
+
|
|
343
|
+
[build]: https://github.com/micromark/micromark-extension-gfm/actions
|
|
344
|
+
|
|
345
|
+
[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark-extension-gfm.svg
|
|
346
|
+
|
|
347
|
+
[coverage]: https://codecov.io/github/micromark/micromark-extension-gfm
|
|
348
|
+
|
|
349
|
+
[downloads-badge]: https://img.shields.io/npm/dm/micromark-extension-gfm.svg
|
|
350
|
+
|
|
351
|
+
[downloads]: https://www.npmjs.com/package/micromark-extension-gfm
|
|
352
|
+
|
|
353
|
+
[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-extension-gfm
|
|
354
|
+
|
|
355
|
+
[size]: https://bundlejs.com/?q=micromark-extension-gfm
|
|
356
|
+
|
|
357
|
+
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
|
|
358
|
+
|
|
359
|
+
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
|
|
360
|
+
|
|
361
|
+
[collective]: https://opencollective.com/unified
|
|
362
|
+
|
|
363
|
+
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
|
|
364
|
+
|
|
365
|
+
[chat]: https://github.com/micromark/micromark/discussions
|
|
366
|
+
|
|
367
|
+
[npm]: https://docs.npmjs.com/cli/install
|
|
368
|
+
|
|
369
|
+
[esmsh]: https://esm.sh
|
|
370
|
+
|
|
371
|
+
[license]: license
|
|
372
|
+
|
|
373
|
+
[author]: https://wooorm.com
|
|
374
|
+
|
|
375
|
+
[contributing]: https://github.com/micromark/.github/blob/main/contributing.md
|
|
376
|
+
|
|
377
|
+
[support]: https://github.com/micromark/.github/blob/main/support.md
|
|
378
|
+
|
|
379
|
+
[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md
|
|
380
|
+
|
|
381
|
+
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
|
|
382
|
+
|
|
383
|
+
[development]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions
|
|
384
|
+
|
|
385
|
+
[typescript]: https://www.typescriptlang.org
|
|
386
|
+
|
|
387
|
+
[gfm]: https://github.github.com/gfm/
|
|
388
|
+
|
|
389
|
+
[strikethrough]: https://github.github.com/gfm/#strikethrough-extension-
|
|
390
|
+
|
|
391
|
+
[tables]: https://github.github.com/gfm/#tables-extension-
|
|
392
|
+
|
|
393
|
+
[tasklists]: https://github.github.com/gfm/#task-list-items-extension-
|
|
394
|
+
|
|
395
|
+
[autolink literals]: https://github.github.com/gfm/#autolinks-extension-
|
|
396
|
+
|
|
397
|
+
[tagfilter]: https://github.github.com/gfm/#disallowed-raw-html-extension-
|
|
398
|
+
|
|
399
|
+
[footnotes]: https://github.blog/changelog/2021-09-30-footnotes-now-supported-in-markdown-fields/
|
|
400
|
+
|
|
401
|
+
[micromark]: https://github.com/micromark/micromark
|
|
402
|
+
|
|
403
|
+
[micromark-extension]: https://github.com/micromark/micromark#syntaxextension
|
|
404
|
+
|
|
405
|
+
[micromark-html-extension]: https://github.com/micromark/micromark#htmlextension
|
|
406
|
+
|
|
407
|
+
[gfm-strikethrough]: https://github.com/micromark/micromark-extension-gfm-strikethrough
|
|
408
|
+
|
|
409
|
+
[gfm-strikethrough-options]: https://github.com/micromark/micromark-extension-gfm-strikethrough#options
|
|
410
|
+
|
|
411
|
+
[gfm-autolink-literal]: https://github.com/micromark/micromark-extension-gfm-autolink-literal
|
|
412
|
+
|
|
413
|
+
[gfm-footnote]: https://github.com/micromark/micromark-extension-gfm-footnote
|
|
414
|
+
|
|
415
|
+
[gfm-footnote-html-options]: https://github.com/micromark/micromark-extension-gfm-footnote#htmloptions
|
|
416
|
+
|
|
417
|
+
[gfm-table]: https://github.com/micromark/micromark-extension-gfm-table
|
|
418
|
+
|
|
419
|
+
[gfm-tagfilter]: https://github.com/micromark/micromark-extension-gfm-tagfilter
|
|
420
|
+
|
|
421
|
+
[gfm-task-list-item]: https://github.com/micromark/micromark-extension-gfm-task-list-item
|
|
422
|
+
|
|
423
|
+
[remark-gfm]: https://github.com/remarkjs/remark-gfm
|
|
424
|
+
|
|
425
|
+
[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm
|
|
426
|
+
|
|
427
|
+
[api-gfm]: #gfmoptions
|
|
428
|
+
|
|
429
|
+
[api-gfm-html]: #gfmhtmloptions
|
|
430
|
+
|
|
431
|
+
[api-options]: #options
|
|
432
|
+
|
|
433
|
+
[api-html-options]: #htmloptions
|