rehype-stringify
Advanced tools
Comparing version 8.0.0 to 9.0.0
16
index.js
@@ -1,15 +0,3 @@ | ||
'use strict' | ||
import rehypeStringify from './lib/index.js' | ||
var toHTML = require('hast-util-to-html') | ||
module.exports = stringify | ||
function stringify(config) { | ||
var settings = Object.assign({}, config, this.data('settings')) | ||
this.Compiler = compiler | ||
function compiler(tree) { | ||
return toHTML(tree, settings) | ||
} | ||
} | ||
export default rehypeStringify |
{ | ||
"name": "rehype-stringify", | ||
"version": "8.0.0", | ||
"version": "9.0.0", | ||
"description": "rehype plugin to serialize HTML", | ||
@@ -21,3 +21,3 @@ "license": "MIT", | ||
"homepage": "https://github.com/rehypejs/rehype", | ||
"repository": "https://github.com/rehypejs/rehype/tree/master/packages/rehype-stringify", | ||
"repository": "https://github.com/rehypejs/rehype/tree/main/packages/rehype-stringify", | ||
"bugs": "https://github.com/rehypejs/rehype/issues", | ||
@@ -32,11 +32,26 @@ "funding": { | ||
], | ||
"sideEffects": false, | ||
"type": "module", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"files": [ | ||
"index.js", | ||
"types/index.d.ts" | ||
"lib/", | ||
"index.d.ts", | ||
"index.js" | ||
], | ||
"types": "types/index.d.ts", | ||
"dependencies": { | ||
"hast-util-to-html": "^7.1.1" | ||
"@types/hast": "^2.0.0", | ||
"hast-util-to-html": "^8.0.0", | ||
"unified": "^10.0.0" | ||
}, | ||
"xo": false | ||
"scripts": { | ||
"build": "rimraf \"lib/**/*.d.ts\" && tsc && type-coverage" | ||
}, | ||
"xo": false, | ||
"typeCoverage": { | ||
"atLeast": 100, | ||
"detail": true, | ||
"strict": true, | ||
"ignoreCatch": true | ||
} | ||
} |
116
readme.md
@@ -22,37 +22,52 @@ # rehype-stringify | ||
<!--lint ignore no-html maximum-line-length--> | ||
Support this effort and give back by sponsoring on [OpenCollective][collective]! | ||
<!--lint ignore no-html--> | ||
<table> | ||
<tr valign="top"> | ||
<td width="20%" align="center"> | ||
<a href="https://vercel.com"><img src="https://avatars1.githubusercontent.com/u/14985020?s=400&v=4"></a> | ||
<br><br>🥇 | ||
<a href="https://vercel.com">Vercel</a> | ||
</td> | ||
<td width="20%" align="center"> | ||
<a href="https://www.gatsbyjs.org"><img src="https://avatars1.githubusercontent.com/u/12551863?s=400&v=4"></a> | ||
<br><br>🥇 | ||
<a href="https://www.gatsbyjs.org">Gatsby</a> | ||
</td> | ||
<td width="20%" align="center"> | ||
<a href="https://www.netlify.com"><img src="https://avatars1.githubusercontent.com/u/7892489?s=400&v=4"></a> | ||
<br><br>🥇 | ||
<a href="https://www.netlify.com">Netlify</a> | ||
</td> | ||
<td width="20%" align="center"> | ||
<a href="https://www.holloway.com"><img src="https://avatars1.githubusercontent.com/u/35904294?s=400&v=4"></a> | ||
<br><br> | ||
<a href="https://www.holloway.com">Holloway</a> | ||
</td> | ||
<td width="20%" align="center"> | ||
<br><br><br><br> | ||
<a href="https://opencollective.com/unified"><strong>You?</strong> | ||
</td> | ||
</tr> | ||
<tr valign="middle"> | ||
<td width="20%" align="center" colspan="2"> | ||
<a href="https://www.gatsbyjs.org">Gatsby</a> 🥇<br><br> | ||
<a href="https://www.gatsbyjs.org"><img src="https://avatars1.githubusercontent.com/u/12551863?s=256&v=4" width="128"></a> | ||
</td> | ||
<td width="20%" align="center" colspan="2"> | ||
<a href="https://vercel.com">Vercel</a> 🥇<br><br> | ||
<a href="https://vercel.com"><img src="https://avatars1.githubusercontent.com/u/14985020?s=256&v=4" width="128"></a> | ||
</td> | ||
<td width="20%" align="center" colspan="2"> | ||
<a href="https://www.netlify.com">Netlify</a><br><br> | ||
<!--OC has a sharper image--> | ||
<a href="https://www.netlify.com"><img src="https://images.opencollective.com/netlify/4087de2/logo/256.png" width="128"></a> | ||
</td> | ||
<td width="10%" align="center"> | ||
<a href="https://www.holloway.com">Holloway</a><br><br> | ||
<a href="https://www.holloway.com"><img src="https://avatars1.githubusercontent.com/u/35904294?s=128&v=4" width="64"></a> | ||
</td> | ||
<td width="10%" align="center"> | ||
<a href="https://themeisle.com">ThemeIsle</a><br><br> | ||
<a href="https://themeisle.com"><img src="https://avatars1.githubusercontent.com/u/58979018?s=128&v=4" width="64"></a> | ||
</td> | ||
<td width="10%" align="center"> | ||
<a href="https://boosthub.io">Boost Hub</a><br><br> | ||
<a href="https://boosthub.io"><img src="https://images.opencollective.com/boosthub/6318083/logo/128.png" width="64"></a> | ||
</td> | ||
<td width="10%" align="center"> | ||
<a href="https://expo.io">Expo</a><br><br> | ||
<a href="https://expo.io"><img src="https://avatars1.githubusercontent.com/u/12504344?s=128&v=4" width="64"></a> | ||
</td> | ||
</tr> | ||
<tr valign="middle"> | ||
<td width="100%" align="center" colspan="10"> | ||
<br> | ||
<a href="https://opencollective.com/unified"><strong>You?</strong></a> | ||
<br><br> | ||
</td> | ||
</tr> | ||
</table> | ||
[**Read more about the unified collective on Medium »**][announcement] | ||
## 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][]: | ||
@@ -67,10 +82,10 @@ | ||
```js | ||
var unified = require('unified') | ||
var createStream = require('unified-stream') | ||
var parse = require('rehype-parse') | ||
var stringify = require('rehype-stringify') | ||
import {unified} from 'unified' | ||
import {stream} from 'unified-stream' | ||
import rehypeParse from 'rehype-parse' | ||
import rehypeStringify from 'rehype-stringify' | ||
var processor = unified() | ||
.use(parse) | ||
.use(stringify, { | ||
const processor = unified() | ||
.use(rehypeParse) | ||
.use(rehypeStringify, { | ||
quoteSmart: true, | ||
@@ -82,3 +97,3 @@ closeSelfClosing: true, | ||
process.stdin.pipe(createStream(processor)).pipe(process.stdout) | ||
process.stdin.pipe(stream(processor)).pipe(process.stdout) | ||
``` | ||
@@ -88,4 +103,7 @@ | ||
### `processor.use(stringify[, options])` | ||
This package exports no identifiers. | ||
The default export is `rehypeStringify`. | ||
### `unified().use(rehypeStringify[, options])` | ||
Configure `processor` to serialize [**hast**][hast] syntax trees to HTML. | ||
@@ -125,5 +143,5 @@ | ||
[build-badge]: https://img.shields.io/travis/rehypejs/rehype.svg | ||
[build-badge]: https://github.com/rehypejs/rehype/workflows/main/badge.svg | ||
[build]: https://travis-ci.org/rehypejs/rehype | ||
[build]: https://github.com/rehypejs/rehype/actions | ||
@@ -148,13 +166,13 @@ [coverage-badge]: https://img.shields.io/codecov/c/github/rehypejs/rehype.svg | ||
[chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg | ||
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg | ||
[chat]: https://spectrum.chat/unified/rehype | ||
[chat]: https://github.com/rehypejs/rehype/discussions | ||
[health]: https://github.com/rehypejs/.github | ||
[contributing]: https://github.com/rehypejs/.github/blob/master/contributing.md | ||
[contributing]: https://github.com/rehypejs/.github/blob/HEAD/contributing.md | ||
[support]: https://github.com/rehypejs/.github/blob/master/support.md | ||
[support]: https://github.com/rehypejs/.github/blob/HEAD/support.md | ||
[coc]: https://github.com/rehypejs/.github/blob/master/code-of-conduct.md | ||
[coc]: https://github.com/rehypejs/.github/blob/HEAD/code-of-conduct.md | ||
@@ -165,3 +183,3 @@ [ideas]: https://github.com/rehypejs/ideas | ||
[license]: https://github.com/rehypejs/rehype/blob/master/license | ||
[license]: https://github.com/rehypejs/rehype/blob/main/license | ||
@@ -176,3 +194,3 @@ [author]: https://wooorm.com | ||
[processor]: https://github.com/rehypejs/rehype/tree/master/packages/rehype | ||
[processor]: https://github.com/rehypejs/rehype/tree/main/packages/rehype | ||
@@ -185,8 +203,6 @@ [compiler]: https://github.com/unifiedjs/unified#processorcompiler | ||
[rehype-dom-stringify]: https://github.com/rehypejs/rehype-dom/tree/master/packages/rehype-dom-stringify | ||
[rehype-dom-stringify]: https://github.com/rehypejs/rehype-dom/tree/HEAD/packages/rehype-dom-stringify | ||
[announcement]: https://medium.com/unifiedjs/collectively-evolving-through-crowdsourcing-22c359ea95cc | ||
[sanitize]: https://github.com/rehypejs/rehype-sanitize | ||
[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
9069
6
36
200
Yes
3
+ Added@types/hast@^2.0.0
+ Addedunified@^10.0.0
+ Added@types/hast@2.3.10(transitive)
+ Added@types/parse5@6.0.3(transitive)
+ Added@types/unist@2.0.11(transitive)
+ Addedbail@2.0.2(transitive)
+ Addedccount@2.0.1(transitive)
+ Addedcharacter-entities-html4@2.1.0(transitive)
+ Addedcharacter-entities-legacy@3.0.0(transitive)
+ Addedcomma-separated-tokens@2.0.3(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedhast-util-from-parse5@7.1.2(transitive)
+ Addedhast-util-parse-selector@3.1.1(transitive)
+ Addedhast-util-raw@7.2.3(transitive)
+ Addedhast-util-to-html@8.0.4(transitive)
+ Addedhast-util-to-parse5@7.1.0(transitive)
+ Addedhast-util-whitespace@2.0.1(transitive)
+ Addedhastscript@7.2.0(transitive)
+ Addedhtml-void-elements@2.0.1(transitive)
+ Addedis-buffer@2.0.5(transitive)
+ Addedis-plain-obj@4.1.0(transitive)
+ Addedparse5@6.0.1(transitive)
+ Addedproperty-information@6.5.0(transitive)
+ Addedspace-separated-tokens@2.0.2(transitive)
+ Addedstringify-entities@4.0.4(transitive)
+ Addedtrough@2.2.0(transitive)
+ Addedunified@10.1.2(transitive)
+ Addedunist-util-is@5.2.1(transitive)
+ Addedunist-util-position@4.0.4(transitive)
+ Addedunist-util-stringify-position@3.0.3(transitive)
+ Addedunist-util-visit@4.1.2(transitive)
+ Addedunist-util-visit-parents@5.1.3(transitive)
+ Addedvfile@5.3.7(transitive)
+ Addedvfile-location@4.1.0(transitive)
+ Addedvfile-message@3.1.4(transitive)
+ Addedweb-namespaces@2.0.1(transitive)
+ Addedzwitch@2.0.4(transitive)
- Removedccount@1.1.0(transitive)
- Removedcharacter-entities-html4@1.1.4(transitive)
- Removedcharacter-entities-legacy@1.1.4(transitive)
- Removedcomma-separated-tokens@1.0.8(transitive)
- Removedhast-util-is-element@1.1.0(transitive)
- Removedhast-util-to-html@7.1.3(transitive)
- Removedhast-util-whitespace@1.0.4(transitive)
- Removedhtml-void-elements@1.0.5(transitive)
- Removedproperty-information@5.6.0(transitive)
- Removedspace-separated-tokens@1.1.5(transitive)
- Removedstringify-entities@3.1.0(transitive)
- Removedunist-util-is@4.1.0(transitive)
- Removedxtend@4.0.2(transitive)
Updatedhast-util-to-html@^8.0.0