This commit is contained in:
39
node_modules/remark-gfm/index.js
generated
vendored
Normal file
39
node_modules/remark-gfm/index.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
'use strict'
|
||||
|
||||
var syntax = require('micromark-extension-gfm')
|
||||
var fromMarkdown = require('mdast-util-gfm/from-markdown')
|
||||
var toMarkdown = require('mdast-util-gfm/to-markdown')
|
||||
|
||||
var warningIssued
|
||||
|
||||
module.exports = gfm
|
||||
|
||||
function gfm(options) {
|
||||
var data = this.data()
|
||||
|
||||
/* istanbul ignore next - old remark. */
|
||||
if (
|
||||
!warningIssued &&
|
||||
((this.Parser &&
|
||||
this.Parser.prototype &&
|
||||
this.Parser.prototype.blockTokenizers) ||
|
||||
(this.Compiler &&
|
||||
this.Compiler.prototype &&
|
||||
this.Compiler.prototype.visitors))
|
||||
) {
|
||||
warningIssued = true
|
||||
console.warn(
|
||||
'[remark-gfm] Warning: please upgrade to remark 13 to use this plugin'
|
||||
)
|
||||
}
|
||||
|
||||
add('micromarkExtensions', syntax(options))
|
||||
add('fromMarkdownExtensions', fromMarkdown)
|
||||
add('toMarkdownExtensions', toMarkdown(options))
|
||||
|
||||
function add(field, value) {
|
||||
/* istanbul ignore if - other extensions. */
|
||||
if (data[field]) data[field].push(value)
|
||||
else data[field] = [value]
|
||||
}
|
||||
}
|
||||
22
node_modules/remark-gfm/license
generated
vendored
Normal file
22
node_modules/remark-gfm/license
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2020 Titus Wormer <tituswormer@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
88
node_modules/remark-gfm/package.json
generated
vendored
Normal file
88
node_modules/remark-gfm/package.json
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
{
|
||||
"name": "remark-gfm",
|
||||
"version": "1.0.0",
|
||||
"description": "remark plugin to support GFM (autolink literals, strikethrough, tables, tasklists)",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"unified",
|
||||
"remark",
|
||||
"remark-plugin",
|
||||
"plugin",
|
||||
"mdast",
|
||||
"markdown",
|
||||
"table",
|
||||
"strikethrough",
|
||||
"tasklist",
|
||||
"autolink",
|
||||
"github",
|
||||
"gfm"
|
||||
],
|
||||
"repository": "remarkjs/remark-gfm",
|
||||
"bugs": "https://github.com/remarkjs/remark-gfm/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)"
|
||||
],
|
||||
"types": "types/index.d.ts",
|
||||
"files": [
|
||||
"types/index.d.ts",
|
||||
"index.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"mdast-util-gfm": "^0.1.0",
|
||||
"micromark-extension-gfm": "^0.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"dtslint": "^4.0.0",
|
||||
"is-hidden": "^1.0.0",
|
||||
"not": "^0.1.0",
|
||||
"nyc": "^15.0.0",
|
||||
"prettier": "^2.0.0",
|
||||
"remark": "^13.0.0-alpha.1",
|
||||
"remark-cli": "^8.0.0",
|
||||
"remark-preset-wooorm": "^7.0.0",
|
||||
"string-width": "^4.2.0",
|
||||
"tape": "^5.0.0",
|
||||
"to-vfile": "^6.0.0",
|
||||
"unified": "^9.0.0",
|
||||
"xo": "^0.33.0"
|
||||
},
|
||||
"scripts": {
|
||||
"format": "remark . -qfo --ignore-pattern test/ && prettier . --write && xo --fix",
|
||||
"test-api": "node test",
|
||||
"test-coverage": "nyc --reporter lcov tape test/index.js",
|
||||
"test-types": "dtslint types",
|
||||
"test": "npm run format && npm run test-coverage && npm run test-types"
|
||||
},
|
||||
"nyc": {
|
||||
"check-coverage": true,
|
||||
"lines": 100,
|
||||
"functions": 100,
|
||||
"branches": 100
|
||||
},
|
||||
"prettier": {
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"singleQuote": true,
|
||||
"bracketSpacing": false,
|
||||
"semi": false,
|
||||
"trailingComma": "none"
|
||||
},
|
||||
"xo": {
|
||||
"prettier": true,
|
||||
"esnext": false,
|
||||
"rules": {
|
||||
"unicorn/no-fn-reference-in-iterator": "off",
|
||||
"unicorn/prefer-optional-catch-binding": "off"
|
||||
}
|
||||
},
|
||||
"remarkConfig": {
|
||||
"plugins": [
|
||||
"preset-wooorm"
|
||||
]
|
||||
}
|
||||
}
|
||||
230
node_modules/remark-gfm/readme.md
generated
vendored
Normal file
230
node_modules/remark-gfm/readme.md
generated
vendored
Normal file
@@ -0,0 +1,230 @@
|
||||
# remark-gfm
|
||||
|
||||
[![Build][build-badge]][build]
|
||||
[![Coverage][coverage-badge]][coverage]
|
||||
[![Downloads][downloads-badge]][downloads]
|
||||
[![Size][size-badge]][size]
|
||||
[![Sponsors][sponsors-badge]][collective]
|
||||
[![Backers][backers-badge]][collective]
|
||||
[![Chat][chat-badge]][chat]
|
||||
|
||||
[**remark**][remark] plugin to support [GitHub Flavored Markdown][gfm].
|
||||
|
||||
## Important!
|
||||
|
||||
This plugin is made for the new parser in remark
|
||||
([`micromark`](https://github.com/micromark/micromark),
|
||||
see [`remarkjs/remark#536`](https://github.com/remarkjs/remark/pull/536)).
|
||||
While you’re still on remark 12, use the `gfm` option for remark.
|
||||
Use this plugin for remark 13+.
|
||||
|
||||
## Install
|
||||
|
||||
[npm][]:
|
||||
|
||||
```sh
|
||||
npm install remark-gfm
|
||||
```
|
||||
|
||||
## Use
|
||||
|
||||
Say we have the following file, `example.md`:
|
||||
|
||||
```markdown
|
||||
# GFM
|
||||
|
||||
## Autolink literals
|
||||
|
||||
www.example.com, https://example.com, and contact@example.com.
|
||||
|
||||
## Strikethrough
|
||||
|
||||
~one~ or ~~two~~ tildes.
|
||||
|
||||
## Table
|
||||
|
||||
| a | b | c | d |
|
||||
| - | :- | -: | :-: |
|
||||
|
||||
## Tasklist
|
||||
|
||||
* [ ] to do
|
||||
* [x] done
|
||||
```
|
||||
|
||||
And our script, `example.js`, looks as follows:
|
||||
|
||||
```js
|
||||
var vfile = require('to-vfile')
|
||||
var report = require('vfile-reporter')
|
||||
var unified = require('unified')
|
||||
var parse = require('remark-parse')
|
||||
var gfm = require('remark-gfm')
|
||||
var remark2rehype = require('remark-rehype')
|
||||
var stringify = require('rehype-stringify')
|
||||
|
||||
unified()
|
||||
.use(parse)
|
||||
.use(gfm)
|
||||
.use(remark2rehype)
|
||||
.use(stringify)
|
||||
.process(vfile.readSync('example.md'), function (err, file) {
|
||||
console.error(report(err || file))
|
||||
console.log(String(file))
|
||||
})
|
||||
```
|
||||
|
||||
Now, running `node example` yields:
|
||||
|
||||
```html
|
||||
example.md: no issues found
|
||||
<h1>GFM</h1>
|
||||
<h2>Autolink literals</h2>
|
||||
<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>Strikethrough</h2>
|
||||
<p><del>one</del> or <del>two</del> tildes.</p>
|
||||
<h2>Table</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>a</th>
|
||||
<th align="left">b</th>
|
||||
<th align="right">c</th>
|
||||
<th align="center">d</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<h2>Tasklist</h2>
|
||||
<ul class="contains-task-list">
|
||||
<li class="task-list-item"><input type="checkbox" disabled> to do</li>
|
||||
<li class="task-list-item"><input type="checkbox" checked disabled> done</li>
|
||||
</ul>
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### `remark().use(gfm[, options])`
|
||||
|
||||
Configures remark so that it can parse and serialize GFM (autolink literals,
|
||||
strikethrough, tables, tasklists).
|
||||
|
||||
##### `options`
|
||||
|
||||
###### `options.singleTilde`
|
||||
|
||||
Whether to support strikethrough with a single tilde (`boolean`, default:
|
||||
`true`).
|
||||
Single tildes work on github.com, but are technically prohibited by the GFM
|
||||
spec.
|
||||
Passed as `singleTilde` to
|
||||
[`micromark-extension-gfm-strikethrough`][strikethrough].
|
||||
|
||||
###### `options.tableCellPadding`
|
||||
|
||||
Create tables with a space between cell delimiters (`|`) and content (`boolean`,
|
||||
default: `true`).
|
||||
Passed to [`mdast-util-gfm-table`][table].
|
||||
|
||||
###### `options.tablePipeAlign`
|
||||
|
||||
Align the delimiters (`|`) between table cells so that they all align nicely and
|
||||
form a grid (`boolean`, default: `true`).
|
||||
Passed to [`mdast-util-gfm-table`][table].
|
||||
|
||||
###### `options.stringLength`
|
||||
|
||||
Function passed to [`markdown-table`][markdown-table] to detect the length of a
|
||||
table cell (`Function`, default: [`s => s.length`][string-length]).
|
||||
Used to align table cells.
|
||||
Passed to [`mdast-util-gfm-table`][table].
|
||||
|
||||
## Security
|
||||
|
||||
Use of `remark-gfm` does not involve [**rehype**][rehype] ([**hast**][hast]) or
|
||||
user content so there are no openings for [cross-site scripting (XSS)][xss]
|
||||
attacks.
|
||||
|
||||
## Related
|
||||
|
||||
* [`remark-github`](https://github.com/remarkjs/remark-github)
|
||||
— Autolink references like in GitHub issues, PRs, and comments
|
||||
* [`remark-footnotes`](https://github.com/remarkjs/remark-footnotes)
|
||||
— Footnotes
|
||||
* [`remark-frontmatter`](https://github.com/remarkjs/remark-frontmatter)
|
||||
— Frontmatter (YAML, TOML, and more)
|
||||
* [`remark-math`](https://github.com/rokt33r/remark-math)
|
||||
— Math
|
||||
|
||||
## Contribute
|
||||
|
||||
See [`contributing.md`][contributing] in [`remarkjs/.github`][health] for ways
|
||||
to get started.
|
||||
See [`support.md`][support] for ways to get help.
|
||||
|
||||
This project has a [code of conduct][coc].
|
||||
By interacting with this repository, organization, or community you agree to
|
||||
abide by its terms.
|
||||
|
||||
## License
|
||||
|
||||
[MIT][license] © [Titus Wormer][author]
|
||||
|
||||
<!-- Definitions -->
|
||||
|
||||
[build-badge]: https://img.shields.io/travis/remarkjs/remark-gfm/main.svg
|
||||
|
||||
[build]: https://travis-ci.org/remarkjs/remark-gfm
|
||||
|
||||
[coverage-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark-gfm.svg
|
||||
|
||||
[coverage]: https://codecov.io/github/remarkjs/remark-gfm
|
||||
|
||||
[downloads-badge]: https://img.shields.io/npm/dm/remark-gfm.svg
|
||||
|
||||
[downloads]: https://www.npmjs.com/package/remark-gfm
|
||||
|
||||
[size-badge]: https://img.shields.io/bundlephobia/minzip/remark-gfm.svg
|
||||
|
||||
[size]: https://bundlephobia.com/result?p=remark-gfm
|
||||
|
||||
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
|
||||
|
||||
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
|
||||
|
||||
[collective]: https://opencollective.com/unified
|
||||
|
||||
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
|
||||
|
||||
[chat]: https://github.com/remarkjs/remark/discussions
|
||||
|
||||
[npm]: https://docs.npmjs.com/cli/install
|
||||
|
||||
[health]: https://github.com/remarkjs/.github
|
||||
|
||||
[contributing]: https://github.com/remarkjs/.github/blob/HEAD/contributing.md
|
||||
|
||||
[support]: https://github.com/remarkjs/.github/blob/HEAD/support.md
|
||||
|
||||
[coc]: https://github.com/remarkjs/.github/blob/HEAD/code-of-conduct.md
|
||||
|
||||
[license]: license
|
||||
|
||||
[author]: https://wooorm.com
|
||||
|
||||
[remark]: https://github.com/remarkjs/remark
|
||||
|
||||
[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting
|
||||
|
||||
[rehype]: https://github.com/rehypejs/rehype
|
||||
|
||||
[hast]: https://github.com/syntax-tree/hast
|
||||
|
||||
[gfm]: https://github.github.com/gfm/
|
||||
|
||||
[table]: https://github.com/syntax-tree/mdast-util-gfm-table#api
|
||||
|
||||
[markdown-table]: https://github.com/wooorm/markdown-table
|
||||
|
||||
[string-length]: https://github.com/wooorm/markdown-table#optionsstringlength
|
||||
|
||||
[strikethrough]: https://github.com/micromark/micromark-extension-gfm-strikethrough#api
|
||||
39
node_modules/remark-gfm/types/index.d.ts
generated
vendored
Normal file
39
node_modules/remark-gfm/types/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
// TypeScript Version: 3.4
|
||||
|
||||
import {Plugin} from 'unified'
|
||||
|
||||
declare namespace remarkGfm {
|
||||
type Gfm = Plugin<[RemarkGfmOptions?]>
|
||||
|
||||
interface RemarkGfmOptions {
|
||||
/**
|
||||
* Whether to support `~single tilde~` strikethrough.
|
||||
*
|
||||
* @defaultValue true
|
||||
*/
|
||||
singleTilde?: boolean
|
||||
/**
|
||||
* Create tables with a space between cell delimiters (`|`) and content.
|
||||
*
|
||||
* @defaultValue true
|
||||
*/
|
||||
tableCellPadding?: boolean
|
||||
/**
|
||||
* Align the delimiters (`|`) between table cells so that they all align
|
||||
* nicely and form a grid.
|
||||
*
|
||||
* @defaultValue true
|
||||
*/
|
||||
tablePipeAlign?: boolean
|
||||
/**
|
||||
* Function to detect the length of a table cell. Used to align tables.
|
||||
*
|
||||
* @defaultValue s => s.length
|
||||
*/
|
||||
stringLength?: (s: string) => number
|
||||
}
|
||||
}
|
||||
|
||||
declare const remarkGfm: remarkGfm.Gfm
|
||||
|
||||
export = remarkGfm
|
||||
Reference in New Issue
Block a user