micromark-extension-gfm
Advanced tools
Comparing version 1.0.0 to 2.0.0
@@ -12,6 +12,16 @@ /** | ||
): Extension | ||
/** @type {HtmlExtension} */ | ||
export const gfmHtml: HtmlExtension | ||
/** | ||
* Support to compile GFM to HTML. | ||
* | ||
* @param {HtmlOptions} [options] | ||
* @returns {HtmlExtension} | ||
*/ | ||
export function gfmHtml( | ||
options?: | ||
| import('micromark-extension-gfm-footnote/lib/html').Options | ||
| undefined | ||
): HtmlExtension | ||
export type Extension = import('micromark-util-types').Extension | ||
export type HtmlExtension = import('micromark-util-types').HtmlExtension | ||
export type Options = import('micromark-extension-gfm-strikethrough').Options | ||
export type HtmlOptions = import('micromark-extension-gfm-footnote').HtmlOptions |
27
index.js
@@ -5,2 +5,3 @@ /** | ||
* @typedef {import('micromark-extension-gfm-strikethrough').Options} Options | ||
* @typedef {import('micromark-extension-gfm-footnote').HtmlOptions} HtmlOptions | ||
*/ | ||
@@ -16,2 +17,3 @@ | ||
} from 'micromark-extension-gfm-autolink-literal' | ||
import {gfmFootnote, gfmFootnoteHtml} from 'micromark-extension-gfm-footnote' | ||
import { | ||
@@ -37,2 +39,3 @@ gfmStrikethrough, | ||
gfmAutolinkLiteral, | ||
gfmFootnote(), | ||
gfmStrikethrough(options), | ||
@@ -44,9 +47,17 @@ gfmTable, | ||
/** @type {HtmlExtension} */ | ||
export const gfmHtml = combineHtmlExtensions([ | ||
gfmAutolinkLiteralHtml, | ||
gfmStrikethroughHtml, | ||
gfmTableHtml, | ||
gfmTagfilterHtml, | ||
gfmTaskListItemHtml | ||
]) | ||
/** | ||
* Support to compile GFM to HTML. | ||
* | ||
* @param {HtmlOptions} [options] | ||
* @returns {HtmlExtension} | ||
*/ | ||
export function gfmHtml(options) { | ||
return combineHtmlExtensions([ | ||
gfmAutolinkLiteralHtml, | ||
gfmFootnoteHtml(options), | ||
gfmStrikethroughHtml, | ||
gfmTableHtml, | ||
gfmTagfilterHtml, | ||
gfmTaskListItemHtml | ||
]) | ||
} |
{ | ||
"name": "micromark-extension-gfm", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "micromark extension to support GFM (GitHub Flavored Markdown)", | ||
@@ -13,2 +13,3 @@ "license": "MIT", | ||
"autolink", | ||
"footnote", | ||
"tagfilter", | ||
@@ -40,2 +41,3 @@ "github", | ||
"micromark-extension-gfm-autolink-literal": "^1.0.0", | ||
"micromark-extension-gfm-footnote": "^1.0.0", | ||
"micromark-extension-gfm-strikethrough": "^1.0.0", | ||
@@ -49,4 +51,3 @@ "micromark-extension-gfm-table": "^1.0.0", | ||
"devDependencies": { | ||
"@types/hast": "^2.3.1", | ||
"@types/node-fetch": "^2.5.10", | ||
"@types/node-fetch": "^3.0.0", | ||
"@types/tape": "^4.0.0", | ||
@@ -57,7 +58,7 @@ "c8": "^7.0.0", | ||
"micromark": "^3.0.0", | ||
"node-fetch": "^2.0.0", | ||
"node-fetch": "^3.0.0", | ||
"prettier": "^2.0.0", | ||
"rehype-parse": "^7.0.0", | ||
"remark-cli": "^9.0.0", | ||
"remark-preset-wooorm": "^8.0.0", | ||
"rehype-parse": "^8.0.0", | ||
"remark-cli": "^10.0.0", | ||
"remark-preset-wooorm": "^9.0.0", | ||
"rimraf": "^3.0.0", | ||
@@ -67,4 +68,4 @@ "tape": "^5.0.0", | ||
"typescript": "^4.0.0", | ||
"unified": "^9.0.0", | ||
"xo": "^0.39.0" | ||
"unified": "^10.0.0", | ||
"xo": "^0.45.0" | ||
}, | ||
@@ -71,0 +72,0 @@ "scripts": { |
@@ -27,2 +27,4 @@ # micromark-extension-gfm | ||
— support GFM [autolink literals][] | ||
* [`micromark/micromark-extension-gfm-footnote`](https://github.com/micromark/micromark-extension-gfm-footnote) | ||
— support GFM footnotes | ||
* [`micromark/micromark-extension-gfm-strikethrough`](https://github.com/micromark/micromark-extension-gfm-strikethrough) | ||
@@ -59,2 +61,8 @@ — support GFM [strikethrough][] | ||
## Footnote | ||
A note[^1] | ||
[^1]: Big note. | ||
## Strikethrough | ||
@@ -89,3 +97,3 @@ | ||
extensions: [gfm()], | ||
htmlExtensions: [gfmHtml] | ||
htmlExtensions: [gfmHtml()] | ||
}) | ||
@@ -102,2 +110,4 @@ | ||
<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> | ||
<h2>Footnote</h2> | ||
<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> | ||
<h2>Strikethrough</h2> | ||
@@ -123,2 +133,9 @@ <p><del>one</del> or <del>two</del> tildes.</p> | ||
</ul> | ||
<section data-footnotes="" class="footnotes"><h2 id="footnote-label" class="sr-only">Footnotes</h2> | ||
<ol> | ||
<li id="user-content-fn-1"> | ||
<p>Big note. <a href="#user-content-fnref-1" data-footnote-backref="" class="data-footnote-backref" aria-label="Back to content">↩</a></p> | ||
</li> | ||
</ol> | ||
</section> | ||
``` | ||
@@ -138,4 +155,4 @@ | ||
micromark to parse GFM (can be passed in `extensions`). | ||
`gfmHtml` is an extension for micromark to compile as elements (can be passed in | ||
`htmlExtensions`). | ||
`gfmHtml` is a function that can be called and returns an extension for | ||
micromark to compile as elements (can be passed in `htmlExtensions`). | ||
@@ -163,2 +180,4 @@ ##### `options` | ||
— support GFM [autolink literals][] | ||
* [`micromark/micromark-extension-gfm-footnote`](https://github.com/micromark/micromark-extension-gfm-footnote) | ||
— support GFM footnotes | ||
* [`micromark/micromark-extension-gfm-strikethrough`](https://github.com/micromark/micromark-extension-gfm-strikethrough) | ||
@@ -165,0 +184,0 @@ — support GFM [strikethrough][] |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14595
17
82
264
8
+ Addedcharacter-entities@2.0.2(transitive)
+ Addeddecode-named-character-reference@1.0.2(transitive)
+ Addedmicromark-core-commonmark@1.1.0(transitive)
+ Addedmicromark-extension-gfm-footnote@1.1.2(transitive)
+ Addedmicromark-factory-destination@1.1.0(transitive)
+ Addedmicromark-factory-label@1.1.0(transitive)
+ Addedmicromark-factory-title@1.1.0(transitive)
+ Addedmicromark-factory-whitespace@1.1.0(transitive)
+ Addedmicromark-util-html-tag-name@1.2.0(transitive)
+ Addedmicromark-util-normalize-identifier@1.1.0(transitive)
+ Addedmicromark-util-subtokenize@1.1.0(transitive)