-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.js
63 lines (60 loc) · 1.86 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
* @import {Extension as FromMarkdownExtension} from 'mdast-util-from-markdown'
* @import {Options} from 'mdast-util-gfm'
* @import {Options as ToMarkdownExtension} from 'mdast-util-to-markdown'
*/
import {
gfmAutolinkLiteralFromMarkdown,
gfmAutolinkLiteralToMarkdown
} from 'mdast-util-gfm-autolink-literal'
import {
gfmFootnoteFromMarkdown,
gfmFootnoteToMarkdown
} from 'mdast-util-gfm-footnote'
import {
gfmStrikethroughFromMarkdown,
gfmStrikethroughToMarkdown
} from 'mdast-util-gfm-strikethrough'
import {gfmTableFromMarkdown, gfmTableToMarkdown} from 'mdast-util-gfm-table'
import {
gfmTaskListItemFromMarkdown,
gfmTaskListItemToMarkdown
} from 'mdast-util-gfm-task-list-item'
/**
* Create an extension for `mdast-util-from-markdown` to enable GFM (autolink
* literals, footnotes, strikethrough, tables, tasklists).
*
* @returns {Array<FromMarkdownExtension>}
* Extension for `mdast-util-from-markdown` to enable GFM (autolink literals,
* footnotes, strikethrough, tables, tasklists).
*/
export function gfmFromMarkdown() {
return [
gfmAutolinkLiteralFromMarkdown(),
gfmFootnoteFromMarkdown(),
gfmStrikethroughFromMarkdown(),
gfmTableFromMarkdown(),
gfmTaskListItemFromMarkdown()
]
}
/**
* Create an extension for `mdast-util-to-markdown` to enable GFM (autolink
* literals, footnotes, strikethrough, tables, tasklists).
*
* @param {Options | null | undefined} [options]
* Configuration (optional).
* @returns {ToMarkdownExtension}
* Extension for `mdast-util-to-markdown` to enable GFM (autolink literals,
* footnotes, strikethrough, tables, tasklists).
*/
export function gfmToMarkdown(options) {
return {
extensions: [
gfmAutolinkLiteralToMarkdown(),
gfmFootnoteToMarkdown(options),
gfmStrikethroughToMarkdown(),
gfmTableToMarkdown(options),
gfmTaskListItemToMarkdown()
]
}
}