mdast-util-gfm-footnote
Advanced tools
Comparing version 2.0.0 to 2.1.0
export {gfmFootnoteFromMarkdown, gfmFootnoteToMarkdown} from './lib/index.js' | ||
export interface ToMarkdownOptions { | ||
// To do: next major: change default. | ||
/** | ||
* Use a blank line for the first line of footnote definitions | ||
* (`boolean`, default: `false`). | ||
*/ | ||
firstLineBlank?: boolean | null | undefined | ||
} | ||
declare module 'mdast-util-to-markdown' { | ||
interface ConstructNameMap { | ||
/** | ||
* Footnote reference. | ||
* Footnote definition. | ||
* | ||
* ```markdown | ||
* > | A[^b]. | ||
* ^^^^ | ||
* > | [^a]: B. | ||
* ^^^^^^^^ | ||
* ``` | ||
*/ | ||
footnoteReference: 'footnoteReference' | ||
footnoteDefinition: 'footnoteDefinition' | ||
/** | ||
* Footnote definition. | ||
* Footnote reference. | ||
* | ||
* ```markdown | ||
* > | [^a]: B. | ||
* ^^^^^^^^ | ||
* > | A[^b]. | ||
* ^^^^ | ||
* ``` | ||
*/ | ||
footnoteDefinition: 'footnoteDefinition' | ||
footnoteReference: 'footnoteReference' | ||
} | ||
} |
@@ -8,3 +8,3 @@ /** | ||
*/ | ||
export function gfmFootnoteFromMarkdown(): FromMarkdownExtension | ||
export function gfmFootnoteFromMarkdown(): FromMarkdownExtension; | ||
/** | ||
@@ -14,13 +14,11 @@ * Create an extension for `mdast-util-to-markdown` to enable GFM footnotes | ||
* | ||
* @param {ToMarkdownOptions | null | undefined} [options] | ||
* Configuration (optional). | ||
* @returns {ToMarkdownExtension} | ||
* Extension for `mdast-util-to-markdown`. | ||
*/ | ||
export function gfmFootnoteToMarkdown(): ToMarkdownExtension | ||
export type FootnoteDefinition = import('mdast').FootnoteDefinition | ||
export type FootnoteReference = import('mdast').FootnoteReference | ||
export type CompileContext = import('mdast-util-from-markdown').CompileContext | ||
export type FromMarkdownExtension = import('mdast-util-from-markdown').Extension | ||
export type FromMarkdownHandle = import('mdast-util-from-markdown').Handle | ||
export type ToMarkdownHandle = import('mdast-util-to-markdown').Handle | ||
export type Map = import('mdast-util-to-markdown').Map | ||
export type ToMarkdownExtension = import('mdast-util-to-markdown').Options | ||
export function gfmFootnoteToMarkdown(options?: ToMarkdownOptions | null | undefined): ToMarkdownExtension; | ||
import type { Extension as FromMarkdownExtension } from 'mdast-util-from-markdown'; | ||
import type { ToMarkdownOptions } from 'mdast-util-gfm-footnote'; | ||
import type { Options as ToMarkdownExtension } from 'mdast-util-to-markdown'; | ||
//# sourceMappingURL=index.d.ts.map |
226
lib/index.js
/** | ||
* @typedef {import('mdast').FootnoteDefinition} FootnoteDefinition | ||
* @typedef {import('mdast').FootnoteReference} FootnoteReference | ||
* @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext | ||
* @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension | ||
* @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle | ||
* @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle | ||
* @typedef {import('mdast-util-to-markdown').Map} Map | ||
* @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension | ||
* @import { | ||
* CompileContext, | ||
* Extension as FromMarkdownExtension, | ||
* Handle as FromMarkdownHandle | ||
* } from 'mdast-util-from-markdown' | ||
* @import {ToMarkdownOptions} from 'mdast-util-gfm-footnote' | ||
* @import { | ||
* Handle as ToMarkdownHandle, | ||
* Map, | ||
* Options as ToMarkdownExtension | ||
* } from 'mdast-util-to-markdown' | ||
* @import {FootnoteDefinition, FootnoteReference} from 'mdast' | ||
*/ | ||
@@ -18,38 +22,15 @@ | ||
/** | ||
* Create an extension for `mdast-util-from-markdown` to enable GFM footnotes | ||
* in markdown. | ||
* | ||
* @returns {FromMarkdownExtension} | ||
* Extension for `mdast-util-from-markdown`. | ||
* @this {CompileContext} | ||
* @type {FromMarkdownHandle} | ||
*/ | ||
export function gfmFootnoteFromMarkdown() { | ||
return { | ||
enter: { | ||
gfmFootnoteDefinition: enterFootnoteDefinition, | ||
gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString, | ||
gfmFootnoteCall: enterFootnoteCall, | ||
gfmFootnoteCallString: enterFootnoteCallString | ||
}, | ||
exit: { | ||
gfmFootnoteDefinition: exitFootnoteDefinition, | ||
gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString, | ||
gfmFootnoteCall: exitFootnoteCall, | ||
gfmFootnoteCallString: exitFootnoteCallString | ||
} | ||
} | ||
function enterFootnoteCallString() { | ||
this.buffer() | ||
} | ||
/** | ||
* Create an extension for `mdast-util-to-markdown` to enable GFM footnotes | ||
* in markdown. | ||
* | ||
* @returns {ToMarkdownExtension} | ||
* Extension for `mdast-util-to-markdown`. | ||
* @this {CompileContext} | ||
* @type {FromMarkdownHandle} | ||
*/ | ||
export function gfmFootnoteToMarkdown() { | ||
return { | ||
// This is on by default already. | ||
unsafe: [{character: '[', inConstruct: ['phrasing', 'label', 'reference']}], | ||
handlers: {footnoteDefinition, footnoteReference} | ||
} | ||
function enterFootnoteCall(token) { | ||
this.enter({type: 'footnoteReference', identifier: '', label: ''}, token) | ||
} | ||
@@ -61,7 +42,4 @@ | ||
*/ | ||
function enterFootnoteDefinition(token) { | ||
this.enter( | ||
{type: 'footnoteDefinition', identifier: '', label: '', children: []}, | ||
token | ||
) | ||
function enterFootnoteDefinitionLabelString() { | ||
this.buffer() | ||
} | ||
@@ -73,4 +51,7 @@ | ||
*/ | ||
function enterFootnoteDefinitionLabelString() { | ||
this.buffer() | ||
function enterFootnoteDefinition(token) { | ||
this.enter( | ||
{type: 'footnoteDefinition', identifier: '', label: '', children: []}, | ||
token | ||
) | ||
} | ||
@@ -82,10 +63,10 @@ | ||
*/ | ||
function exitFootnoteDefinitionLabelString(token) { | ||
function exitFootnoteCallString(token) { | ||
const label = this.resume() | ||
const node = this.stack[this.stack.length - 1] | ||
assert(node.type === 'footnoteDefinition') | ||
node.label = label | ||
assert(node.type === 'footnoteReference') | ||
node.identifier = normalizeIdentifier( | ||
this.sliceSerialize(token) | ||
).toLowerCase() | ||
node.label = label | ||
} | ||
@@ -97,3 +78,3 @@ | ||
*/ | ||
function exitFootnoteDefinition(token) { | ||
function exitFootnoteCall(token) { | ||
this.exit(token) | ||
@@ -106,26 +87,10 @@ } | ||
*/ | ||
function enterFootnoteCall(token) { | ||
this.enter({type: 'footnoteReference', identifier: '', label: ''}, token) | ||
} | ||
/** | ||
* @this {CompileContext} | ||
* @type {FromMarkdownHandle} | ||
*/ | ||
function enterFootnoteCallString() { | ||
this.buffer() | ||
} | ||
/** | ||
* @this {CompileContext} | ||
* @type {FromMarkdownHandle} | ||
*/ | ||
function exitFootnoteCallString(token) { | ||
function exitFootnoteDefinitionLabelString(token) { | ||
const label = this.resume() | ||
const node = this.stack[this.stack.length - 1] | ||
assert(node.type === 'footnoteReference') | ||
node.label = label | ||
assert(node.type === 'footnoteDefinition') | ||
node.identifier = normalizeIdentifier( | ||
this.sliceSerialize(token) | ||
).toLowerCase() | ||
node.label = label | ||
} | ||
@@ -137,6 +102,11 @@ | ||
*/ | ||
function exitFootnoteCall(token) { | ||
function exitFootnoteDefinition(token) { | ||
this.exit(token) | ||
} | ||
/** @type {ToMarkdownHandle} */ | ||
function footnoteReferencePeek() { | ||
return '[' | ||
} | ||
/** | ||
@@ -152,7 +122,3 @@ * @type {ToMarkdownHandle} | ||
value += tracker.move( | ||
state.safe(state.associationId(node), { | ||
...tracker.current(), | ||
before: value, | ||
after: ']' | ||
}) | ||
state.safe(state.associationId(node), {after: ']', before: value}) | ||
) | ||
@@ -165,43 +131,91 @@ subexit() | ||
/** @type {ToMarkdownHandle} */ | ||
function footnoteReferencePeek() { | ||
return '[' | ||
/** | ||
* Create an extension for `mdast-util-from-markdown` to enable GFM footnotes | ||
* in markdown. | ||
* | ||
* @returns {FromMarkdownExtension} | ||
* Extension for `mdast-util-from-markdown`. | ||
*/ | ||
export function gfmFootnoteFromMarkdown() { | ||
return { | ||
enter: { | ||
gfmFootnoteCallString: enterFootnoteCallString, | ||
gfmFootnoteCall: enterFootnoteCall, | ||
gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString, | ||
gfmFootnoteDefinition: enterFootnoteDefinition | ||
}, | ||
exit: { | ||
gfmFootnoteCallString: exitFootnoteCallString, | ||
gfmFootnoteCall: exitFootnoteCall, | ||
gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString, | ||
gfmFootnoteDefinition: exitFootnoteDefinition | ||
} | ||
} | ||
} | ||
/** | ||
* @type {ToMarkdownHandle} | ||
* @param {FootnoteDefinition} node | ||
* Create an extension for `mdast-util-to-markdown` to enable GFM footnotes | ||
* in markdown. | ||
* | ||
* @param {ToMarkdownOptions | null | undefined} [options] | ||
* Configuration (optional). | ||
* @returns {ToMarkdownExtension} | ||
* Extension for `mdast-util-to-markdown`. | ||
*/ | ||
function footnoteDefinition(node, _, state, info) { | ||
const tracker = state.createTracker(info) | ||
let value = tracker.move('[^') | ||
const exit = state.enter('footnoteDefinition') | ||
const subexit = state.enter('label') | ||
value += tracker.move( | ||
state.safe(state.associationId(node), { | ||
...tracker.current(), | ||
before: value, | ||
after: ']' | ||
}) | ||
) | ||
subexit() | ||
value += tracker.move( | ||
']:' + (node.children && node.children.length > 0 ? ' ' : '') | ||
) | ||
tracker.shift(4) | ||
value += tracker.move( | ||
state.indentLines(state.containerFlow(node, tracker.current()), map) | ||
) | ||
exit() | ||
export function gfmFootnoteToMarkdown(options) { | ||
// To do: next major: change default. | ||
let firstLineBlank = false | ||
return value | ||
if (options && options.firstLineBlank) { | ||
firstLineBlank = true | ||
} | ||
return { | ||
handlers: {footnoteDefinition, footnoteReference}, | ||
// This is on by default already. | ||
unsafe: [{character: '[', inConstruct: ['label', 'phrasing', 'reference']}] | ||
} | ||
/** | ||
* @type {ToMarkdownHandle} | ||
* @param {FootnoteDefinition} node | ||
*/ | ||
function footnoteDefinition(node, _, state, info) { | ||
const tracker = state.createTracker(info) | ||
let value = tracker.move('[^') | ||
const exit = state.enter('footnoteDefinition') | ||
const subexit = state.enter('label') | ||
value += tracker.move( | ||
state.safe(state.associationId(node), {before: value, after: ']'}) | ||
) | ||
subexit() | ||
value += tracker.move(']:') | ||
if (node.children && node.children.length > 0) { | ||
tracker.shift(4) | ||
value += tracker.move( | ||
(firstLineBlank ? '\n' : ' ') + | ||
state.indentLines( | ||
state.containerFlow(node, tracker.current()), | ||
firstLineBlank ? mapAll : mapExceptFirst | ||
) | ||
) | ||
} | ||
exit() | ||
return value | ||
} | ||
} | ||
/** @type {Map} */ | ||
function map(line, index, blank) { | ||
if (index === 0) { | ||
return line | ||
} | ||
function mapExceptFirst(line, index, blank) { | ||
return index === 0 ? line : mapAll(line, index, blank) | ||
} | ||
/** @type {Map} */ | ||
function mapAll(line, index, blank) { | ||
return (blank ? '' : ' ') + line | ||
} |
115
package.json
{ | ||
"name": "mdast-util-gfm-footnote", | ||
"version": "2.0.0", | ||
"description": "mdast extension to parse and serialize GFM footnotes", | ||
"license": "MIT", | ||
"keywords": [ | ||
"unist", | ||
"mdast", | ||
"mdast-util", | ||
"util", | ||
"utility", | ||
"markdown", | ||
"markup", | ||
"gfm", | ||
"footnote", | ||
"note" | ||
], | ||
"repository": "syntax-tree/mdast-util-gfm-footnote", | ||
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)", | ||
"bugs": "https://github.com/syntax-tree/mdast-util-gfm-footnote/issues", | ||
"funding": { | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/unified" | ||
}, | ||
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)", | ||
"contributors": [ | ||
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)" | ||
], | ||
"sideEffects": false, | ||
"type": "module", | ||
"exports": "./index.js", | ||
"files": [ | ||
"lib/", | ||
"index.d.ts", | ||
"index.js" | ||
], | ||
"dependencies": { | ||
@@ -43,23 +14,38 @@ "@types/mdast": "^4.0.0", | ||
}, | ||
"description": "mdast extension to parse and serialize GFM footnotes", | ||
"devDependencies": { | ||
"@types/node": "^20.0.0", | ||
"c8": "^8.0.0", | ||
"@types/node": "^22.0.0", | ||
"c8": "^10.0.0", | ||
"micromark-extension-gfm-footnote": "^2.0.0", | ||
"prettier": "^2.0.0", | ||
"remark-cli": "^11.0.0", | ||
"remark-preset-wooorm": "^9.0.0", | ||
"prettier": "^3.0.0", | ||
"remark-cli": "^12.0.0", | ||
"remark-preset-wooorm": "^11.0.0", | ||
"type-coverage": "^2.0.0", | ||
"typescript": "^5.0.0", | ||
"xo": "^0.54.0" | ||
"xo": "^0.60.0" | ||
}, | ||
"scripts": { | ||
"prepack": "npm run build && npm run format", | ||
"build": "tsc --build --clean && tsc --build && type-coverage", | ||
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", | ||
"test-api-dev": "node --conditions development test.js", | ||
"test-api-prod": "node --conditions production test.js", | ||
"test-api": "npm run test-api-dev && npm run test-api-prod", | ||
"test-coverage": "c8 --100 --reporter lcov npm run test-api", | ||
"test": "npm run build && npm run format && npm run test-coverage" | ||
"exports": "./index.js", | ||
"files": [ | ||
"index.d.ts", | ||
"index.js", | ||
"lib/" | ||
], | ||
"funding": { | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/unified" | ||
}, | ||
"keywords": [ | ||
"footnote", | ||
"gfm", | ||
"markdown", | ||
"markup", | ||
"mdast-util", | ||
"mdast", | ||
"note", | ||
"unist", | ||
"utility", | ||
"util" | ||
], | ||
"license": "MIT", | ||
"name": "mdast-util-gfm-footnote", | ||
"prettier": { | ||
@@ -78,8 +64,19 @@ "bracketSpacing": false, | ||
}, | ||
"repository": "syntax-tree/mdast-util-gfm-footnote", | ||
"scripts": { | ||
"build": "tsc --build --clean && tsc --build && type-coverage", | ||
"format": "remark --frail --output --quiet -- . && prettier --log-level warn --write -- . && xo --fix", | ||
"test-api-dev": "node --conditions development test.js", | ||
"test-api-prod": "node --conditions production test.js", | ||
"test-api": "npm run test-api-dev && npm run test-api-prod", | ||
"test-coverage": "c8 --100 --reporter lcov npm run test-api", | ||
"test": "npm run build && npm run format && npm run test-coverage" | ||
}, | ||
"sideEffects": false, | ||
"typeCoverage": { | ||
"atLeast": 100, | ||
"detail": true, | ||
"ignoreCatch": true, | ||
"strict": true | ||
}, | ||
"type": "module", | ||
"version": "2.1.0", | ||
"xo": { | ||
@@ -89,11 +86,29 @@ "overrides": [ | ||
"files": [ | ||
"**/*.ts" | ||
"**/*.d.ts" | ||
], | ||
"rules": { | ||
"@typescript-eslint/consistent-type-definitions": "off" | ||
"@typescript-eslint/array-type": [ | ||
"error", | ||
{ | ||
"default": "generic" | ||
} | ||
], | ||
"@typescript-eslint/ban-types": [ | ||
"error", | ||
{ | ||
"extendDefaults": true | ||
} | ||
], | ||
"@typescript-eslint/consistent-type-definitions": [ | ||
"error", | ||
"interface" | ||
] | ||
} | ||
} | ||
], | ||
"prettier": true | ||
"prettier": true, | ||
"rules": { | ||
"unicorn/prefer-at": "off" | ||
} | ||
} | ||
} |
229
readme.md
@@ -15,19 +15,20 @@ # mdast-util-gfm-footnote | ||
* [What is this?](#what-is-this) | ||
* [When to use this](#when-to-use-this) | ||
* [Install](#install) | ||
* [Use](#use) | ||
* [API](#api) | ||
* [`gfmFootnoteFromMarkdown()`](#gfmfootnotefrommarkdown) | ||
* [`gfmFootnoteToMarkdown()`](#gfmfootnotetomarkdown) | ||
* [HTML](#html) | ||
* [Syntax](#syntax) | ||
* [Syntax tree](#syntax-tree) | ||
* [Nodes](#nodes) | ||
* [Content model](#content-model) | ||
* [Types](#types) | ||
* [Compatibility](#compatibility) | ||
* [Related](#related) | ||
* [Contribute](#contribute) | ||
* [License](#license) | ||
* [What is this?](#what-is-this) | ||
* [When to use this](#when-to-use-this) | ||
* [Install](#install) | ||
* [Use](#use) | ||
* [API](#api) | ||
* [`gfmFootnoteFromMarkdown()`](#gfmfootnotefrommarkdown) | ||
* [`gfmFootnoteToMarkdown(options?)`](#gfmfootnotetomarkdownoptions) | ||
* [`ToMarkdownOptions`](#tomarkdownoptions) | ||
* [HTML](#html) | ||
* [Syntax](#syntax) | ||
* [Syntax tree](#syntax-tree) | ||
* [Nodes](#nodes) | ||
* [Content model](#content-model) | ||
* [Types](#types) | ||
* [Compatibility](#compatibility) | ||
* [Related](#related) | ||
* [Contribute](#contribute) | ||
* [License](#license) | ||
@@ -98,5 +99,11 @@ ## What is this? | ||
```markdown | ||
Hi![^1] | ||
In the Solar System, Mercury[^mercury] and Venus[^venus] have very small tilts. | ||
[^1]: big note | ||
[^mercury]: | ||
**Mercury** is the first planet from the Sun and the smallest | ||
in the Solar System. | ||
[^venus]: | ||
**Venus** is the second planet from | ||
the Sun. | ||
``` | ||
@@ -109,9 +116,12 @@ | ||
import {fromMarkdown} from 'mdast-util-from-markdown' | ||
import { | ||
gfmFootnoteFromMarkdown, | ||
gfmFootnoteToMarkdown | ||
} from 'mdast-util-gfm-footnote' | ||
import {toMarkdown} from 'mdast-util-to-markdown' | ||
import {gfmFootnote} from 'micromark-extension-gfm-footnote' | ||
import {gfmFootnoteFromMarkdown, gfmFootnoteToMarkdown} from 'mdast-util-gfm-footnote' | ||
const doc = await fs.readFile('example.md') | ||
const value = await fs.readFile('example.md', 'utf8') | ||
const tree = fromMarkdown(doc, { | ||
const tree = fromMarkdown(value, { | ||
extensions: [gfmFootnote()], | ||
@@ -123,5 +133,7 @@ mdastExtensions: [gfmFootnoteFromMarkdown()] | ||
const out = toMarkdown(tree, {extensions: [gfmFootnoteToMarkdown()]}) | ||
const result = toMarkdown(tree, { | ||
extensions: [gfmFootnoteToMarkdown({firstLineBlank: true})] | ||
}) | ||
console.log(out) | ||
console.log(result) | ||
``` | ||
@@ -138,4 +150,7 @@ | ||
children: [ | ||
{type: 'text', value: 'Hi!'}, | ||
{type: 'footnoteReference', identifier: '1', label: '1'} | ||
{type: 'text', value: 'In the Solar System, Mercury'}, | ||
{type: 'footnoteReference', identifier: 'mercury', label: 'mercury'}, | ||
{type: 'text', value: ' and Venus'}, | ||
{type: 'footnoteReference', identifier: 'venus', label: 'venus'}, | ||
{type: 'text', value: ' have very small tilts.'} | ||
] | ||
@@ -145,7 +160,32 @@ }, | ||
type: 'footnoteDefinition', | ||
identifier: '1', | ||
label: '1', | ||
identifier: 'mercury', | ||
label: 'mercury', | ||
children: [ | ||
{type: 'paragraph', children: [{type: 'text', value: 'big note'}]} | ||
{ | ||
type: 'paragraph', | ||
children: [ | ||
{type: 'strong', children: [{type: 'text', value: 'Mercury'}]}, | ||
{ | ||
type: 'text', | ||
value: | ||
' is the first planet from the Sun and the smallest\n' + | ||
'in the Solar System.' | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
type: 'footnoteDefinition', | ||
identifier: 'venus', | ||
label: 'venus', | ||
children: [ | ||
{ | ||
type: 'paragraph', | ||
children: [ | ||
{type: 'strong', children: [{type: 'text', value: 'Venus'}]}, | ||
{type: 'text', value: ' is the second planet from\nthe Sun.'} | ||
] | ||
} | ||
] | ||
} | ||
@@ -157,5 +197,11 @@ ] | ||
```markdown | ||
Hi\![^1] | ||
In the Solar System, Mercury[^mercury] and Venus[^venus] have very small tilts. | ||
[^1]: big note | ||
[^mercury]: | ||
**Mercury** is the first planet from the Sun and the smallest | ||
in the Solar System. | ||
[^venus]: | ||
**Venus** is the second planet from | ||
the Sun. | ||
``` | ||
@@ -169,2 +215,3 @@ | ||
There is no default export. | ||
It exports the type [`ToMarkdownOptions`][api-to-markdown-options]. | ||
@@ -182,3 +229,3 @@ ### `gfmFootnoteFromMarkdown()` | ||
### `gfmFootnoteToMarkdown()` | ||
### `gfmFootnoteToMarkdown(options?)` | ||
@@ -189,2 +236,7 @@ Create an extension for | ||
###### Parameters | ||
* `options` ([`ToMarkdownOptions`][api-to-markdown-options], optional) | ||
— configuration | ||
###### Returns | ||
@@ -195,2 +247,11 @@ | ||
### `ToMarkdownOptions` | ||
Configuration (TypeScript type). | ||
###### Fields | ||
* `firstLineBlank` (`boolean`, default: `false`) | ||
— use a blank line for the first line of footnote definitions | ||
## HTML | ||
@@ -328,9 +389,9 @@ | ||
* [`remark-gfm`][remark-gfm] | ||
— remark plugin to support GFM | ||
* [`mdast-util-gfm`][mdast-util-gfm] | ||
— same but all of GFM (autolink literals, footnotes, strikethrough, tables, | ||
tasklists) | ||
* [`micromark-extension-gfm-footnote`][micromark-extension-gfm-footnote] | ||
— micromark extension to parse GFM footnotes | ||
* [`remark-gfm`][remark-gfm] | ||
— remark plugin to support GFM | ||
* [`mdast-util-gfm`][mdast-util-gfm] | ||
— same but all of GFM (autolink literals, footnotes, strikethrough, tables, | ||
tasklists) | ||
* [`micromark-extension-gfm-footnote`][micromark-extension-gfm-footnote] | ||
— micromark extension to parse GFM footnotes | ||
@@ -353,92 +414,94 @@ ## Contribute | ||
[build-badge]: https://github.com/syntax-tree/mdast-util-gfm-footnote/workflows/main/badge.svg | ||
[api-gfmfootnotefrommarkdown]: #gfmfootnotefrommarkdown | ||
[build]: https://github.com/syntax-tree/mdast-util-gfm-footnote/actions | ||
[api-gfmfootnotetomarkdown]: #gfmfootnotetomarkdownoptions | ||
[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-gfm-footnote.svg | ||
[api-to-markdown-options]: #tomarkdownoptions | ||
[coverage]: https://codecov.io/github/syntax-tree/mdast-util-gfm-footnote | ||
[author]: https://wooorm.com | ||
[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-gfm-footnote.svg | ||
[backers-badge]: https://opencollective.com/unified/backers/badge.svg | ||
[downloads]: https://www.npmjs.com/package/mdast-util-gfm-footnote | ||
[build]: https://github.com/syntax-tree/mdast-util-gfm-footnote/actions | ||
[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-gfm-footnote | ||
[build-badge]: https://github.com/syntax-tree/mdast-util-gfm-footnote/workflows/main/badge.svg | ||
[size]: https://bundlejs.com/?q=mdast-util-gfm-footnote | ||
[chat]: https://github.com/syntax-tree/unist/discussions | ||
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg | ||
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg | ||
[backers-badge]: https://opencollective.com/unified/backers/badge.svg | ||
[cmark-gfm]: https://github.com/github/cmark-gfm | ||
[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md | ||
[collective]: https://opencollective.com/unified | ||
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg | ||
[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md | ||
[chat]: https://github.com/syntax-tree/unist/discussions | ||
[coverage]: https://codecov.io/github/syntax-tree/mdast-util-gfm-footnote | ||
[npm]: https://docs.npmjs.com/cli/install | ||
[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-gfm-footnote.svg | ||
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c | ||
[dfn-flow-content]: #flowcontent-gfm-footnotes | ||
[esmsh]: https://esm.sh | ||
[dfn-footnote-definition]: #footnotedefinition | ||
[typescript]: https://www.typescriptlang.org | ||
[dfn-footnote-reference]: #footnotereference | ||
[license]: license | ||
[dfn-mxn-association]: https://github.com/syntax-tree/mdast#association | ||
[author]: https://wooorm.com | ||
[dfn-node]: https://github.com/syntax-tree/unist#node | ||
[health]: https://github.com/syntax-tree/.github | ||
[dfn-parent]: https://github.com/syntax-tree/mdast#parent | ||
[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md | ||
[dfn-phrasing-content]: #phrasingcontent-gfm-footnotes | ||
[support]: https://github.com/syntax-tree/.github/blob/main/support.md | ||
[downloads]: https://www.npmjs.com/package/mdast-util-gfm-footnote | ||
[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md | ||
[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-gfm-footnote.svg | ||
[mdast]: https://github.com/syntax-tree/mdast | ||
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c | ||
[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm | ||
[esmsh]: https://esm.sh | ||
[remark-gfm]: https://github.com/remarkjs/remark-gfm | ||
[frommarkdownextension]: https://github.com/syntax-tree/mdast-util-from-markdown#extension | ||
[micromark]: https://github.com/micromark/micromark | ||
[gfm]: https://github.github.com/gfm/ | ||
[micromark-extension-gfm-footnote]: https://github.com/micromark/micromark-extension-gfm-footnote | ||
[health]: https://github.com/syntax-tree/.github | ||
[syntax]: https://github.com/micromark/micromark-extension-gfm-footnote#syntax | ||
[license]: license | ||
[gfm]: https://github.github.com/gfm/ | ||
[mdast]: https://github.com/syntax-tree/mdast | ||
[cmark-gfm]: https://github.com/github/cmark-gfm | ||
[mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown | ||
[post]: https://github.blog/changelog/2021-09-30-footnotes-now-supported-in-markdown-fields/ | ||
[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm | ||
[mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown | ||
[mdast-util-to-hast]: https://github.com/syntax-tree/mdast-util-to-hast | ||
[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown | ||
[mdast-util-to-hast]: https://github.com/syntax-tree/mdast-util-to-hast | ||
[micromark]: https://github.com/micromark/micromark | ||
[dfn-parent]: https://github.com/syntax-tree/mdast#parent | ||
[micromark-extension-gfm-footnote]: https://github.com/micromark/micromark-extension-gfm-footnote | ||
[dfn-mxn-association]: https://github.com/syntax-tree/mdast#association | ||
[npm]: https://docs.npmjs.com/cli/install | ||
[dfn-node]: https://github.com/syntax-tree/unist#node | ||
[post]: https://github.blog/changelog/2021-09-30-footnotes-now-supported-in-markdown-fields/ | ||
[frommarkdownextension]: https://github.com/syntax-tree/mdast-util-from-markdown#extension | ||
[remark-gfm]: https://github.com/remarkjs/remark-gfm | ||
[tomarkdownextension]: https://github.com/syntax-tree/mdast-util-to-markdown#options | ||
[size]: https://bundlejs.com/?q=mdast-util-gfm-footnote | ||
[dfn-flow-content]: #flowcontent-gfm-footnotes | ||
[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-gfm-footnote | ||
[dfn-phrasing-content]: #phrasingcontent-gfm-footnotes | ||
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg | ||
[dfn-footnote-reference]: #footnotereference | ||
[support]: https://github.com/syntax-tree/.github/blob/main/support.md | ||
[dfn-footnote-definition]: #footnotedefinition | ||
[syntax]: https://github.com/micromark/micromark-extension-gfm-footnote#syntax | ||
[api-gfmfootnotefrommarkdown]: #gfmfootnotefrommarkdown | ||
[tomarkdownextension]: https://github.com/syntax-tree/mdast-util-to-markdown#options | ||
[api-gfmfootnotetomarkdown]: #gfmfootnotetomarkdown | ||
[typescript]: https://www.typescriptlang.org |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
24051
8
242
495
1