Socket
Socket
Sign inDemoInstall

micromark-extension-gfm-task-list-item

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micromark-extension-gfm-task-list-item - npm Package Compare versions

Comparing version 0.3.3 to 1.0.0

dev/index.d.ts

3

index.js

@@ -1,1 +0,2 @@

module.exports = require('./syntax')
export {gfmTaskListItemHtml} from './lib/html.js'
export {gfmTaskListItem} from './lib/syntax.js'
{
"name": "micromark-extension-gfm-task-list-item",
"version": "0.3.3",
"version": "1.0.0",
"description": "micromark extension to support GFM task list items",

@@ -29,31 +29,44 @@ "license": "MIT",

],
"sideEffects": false,
"type": "module",
"main": "index.js",
"types": "index.d.ts",
"files": [
"index.js",
"html.js",
"syntax.js"
"dev/",
"lib/",
"index.d.ts",
"index.js"
],
"exports": {
"development": "./dev/index.js",
"default": "./index.js"
},
"dependencies": {
"micromark": "~2.11.0"
"micromark-factory-space": "^1.0.0",
"micromark-util-character": "^1.0.0",
"micromark-util-symbol": "^1.0.0",
"micromark-util-types": "^1.0.0"
},
"devDependencies": {
"control-pictures": "^1.0.0",
"nyc": "^15.0.0",
"@types/tape": "^4.0.0",
"c8": "^7.0.0",
"control-pictures": "^2.0.0",
"micromark": "^3.0.0",
"micromark-build": "^1.0.0",
"prettier": "^2.0.0",
"remark-cli": "^9.0.0",
"remark-preset-wooorm": "^8.0.0",
"rimraf": "^3.0.0",
"tape": "^5.0.0",
"xo": "^0.36.0"
"type-coverage": "^2.0.0",
"typescript": "^4.0.0",
"xo": "^0.39.0"
},
"scripts": {
"build": "rimraf \"dev/**/*.d.ts\" \"test/**/*.d.ts\" && tsc && type-coverage && micromark-build",
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
"test-api": "node test",
"test-coverage": "nyc --reporter lcov tape test/index.js",
"test": "npm run format && npm run test-coverage"
"test-api": "node --conditions development test/index.js",
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node --conditions development test/index.js",
"test": "npm run build && npm run format && npm run test-coverage"
},
"nyc": {
"check-coverage": true,
"lines": 100,
"functions": 100,
"branches": 100
},
"prettier": {

@@ -69,3 +82,5 @@ "tabWidth": 2,

"prettier": true,
"esnext": false
"rules": {
"unicorn/no-this-assignment": "off"
}
},

@@ -76,3 +91,9 @@ "remarkConfig": {

]
},
"typeCoverage": {
"atLeast": 100,
"detail": true,
"strict": true,
"ignoreCatch": true
}
}

@@ -11,3 +11,3 @@ # micromark-extension-gfm-task-list-item

**[micromark][]** extension to support GitHub flavored markdown [task list
**[micromark][]** extension to support GitHub flavored markdown (GFM) [task list
items][].

@@ -17,11 +17,13 @@ This extension matches the GFM spec for the few things it defines and otherwise

This package provides the low-level modules for integrating with the micromark
tokenizer and the micromark HTML compiler.
## When to use this
You probably shouldn’t use this package directly, but instead use
[`mdast-util-gfm-task-list-item`][mdast-util-gfm-task-list-item] with
**[mdast][]**.
You should probably use [`micromark-extension-gfm`][micromark-extension-gfm]
instead, which combines this package with other GFM features.
Alternatively, if you don’t want all of GFM, use this package.
## Install
This package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c):
Node 12+ is needed to use it and it must be `import`ed instead of `require`d.
[npm][]:

@@ -33,15 +35,46 @@

## Use
```js
import {micromark} from 'micromark'
import {
gfmTaskListItem,
gfmTaskListItemHtml
} from 'micromark-extension-gfm-task-list-item'
const output = micromark('* [x] a\n* [ ] b', {
extensions: [gfmTaskListItem],
htmlExtensions: [gfmTaskListItemHtml]
})
console.log(output)
```
Yields:
```html
<ul>
<li><input checked="" disabled="" type="checkbox"> a</li>
<li><input disabled="" type="checkbox"> b</li>
</ul>
```
## API
### `html`
This package exports the following identifiers: `gfmTaskListItem`,
`gfmTaskListItemHtml`.
There is no default export.
### `syntax`
The export map supports the endorsed
[`development` condition](https://nodejs.org/api/packages.html#packages_resolving_user_conditions).
Run `node --conditions development module.js` to get instrumented dev code.
Without this condition, production code is loaded.
> Note: `syntax` is the default export of this module, `html` is available at
> `micromark-extension-gfm-task-list-item/html`.
### `gfmTaskListItem`
### `gfmTaskListItemHtml`
Support [task list items][].
The exports are extensions for the micromark parser (to tokenize checks; can be
passed in `extensions`) and the default HTML compiler (to compile as `<input>`
elements; can be passed in `htmlExtensions`).
An extension for micromark to parse checks (can be passed in `extensions`) and
one to compile as `<input>` elements (can be passed in `htmlExtensions`).

@@ -52,6 +85,12 @@ ## Related

— markdown processor powered by plugins
* [`remarkjs/remark-gfm`](https://github.com/remarkjs/remark-gfm)
— remark plugin using this and other GFM features
* [`micromark/micromark`][micromark]
— the smallest commonmark-compliant markdown parser that exists
* [`micromark/micromark-extension-gfm`][micromark-extension-gfm]
— micromark extension combining this with other GFM features
* [`syntax-tree/mdast-util-gfm-task-list-item`](https://github.com/syntax-tree/mdast-util-gfm-task-list-item)
— mdast utility to support task lists
* [`syntax-tree/mdast-util-gfm`](https://github.com/syntax-tree/mdast-util-gfm)
— mdast utility to support GFM
* [`syntax-tree/mdast-util-from-markdown`][from-markdown]

@@ -124,6 +163,4 @@ — mdast parser using `micromark` to create mdast from markdown

[mdast]: https://github.com/syntax-tree/mdast
[task list items]: https://github.github.com/gfm/#task-list-items-extension-
[mdast-util-gfm-task-list-item]: https://github.com/syntax-tree/mdast-util-gfm-task-list-item
[task list items]: https://github.github.com/gfm/#task-list-items-extension-
[micromark-extension-gfm]: https://github.com/micromark/micromark-extension-gfm
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc