Comparing version 12.0.1 to 13.0.0
@@ -1,6 +0,5 @@ | ||
export const rehype: import('unified').FrozenProcessor< | ||
import('hast').Root, | ||
import('hast').Root, | ||
import('hast').Root, | ||
string | ||
> | ||
/** | ||
* Create a new unified processor that already uses `rehype-parse` and | ||
* `rehype-stringify`. | ||
*/ | ||
export const rehype: import("unified").Processor<import("hast").Root, undefined, undefined, import("hast").Root, string>; |
@@ -1,5 +0,9 @@ | ||
import {unified} from 'unified' | ||
import rehypeParse from 'rehype-parse' | ||
import rehypeStringify from 'rehype-stringify' | ||
import {unified} from 'unified' | ||
/** | ||
* Create a new unified processor that already uses `rehype-parse` and | ||
* `rehype-stringify`. | ||
*/ | ||
export const rehype = unified().use(rehypeParse).use(rehypeStringify).freeze() |
{ | ||
"name": "rehype", | ||
"version": "12.0.1", | ||
"version": "13.0.0", | ||
"description": "HTML processor powered by plugins part of the unified collective", | ||
"license": "MIT", | ||
"keywords": [ | ||
"unified", | ||
"rehype", | ||
"html", | ||
"abstract", | ||
"syntax", | ||
"tree", | ||
"ast", | ||
"html", | ||
"parse", | ||
"process", | ||
"rehype", | ||
"serialize", | ||
"stringify", | ||
"serialize", | ||
"process" | ||
"syntax", | ||
"tree", | ||
"unified" | ||
], | ||
"dependencies": { | ||
"@types/hast": "^2.0.0", | ||
"rehype-parse": "^8.0.0", | ||
"rehype-stringify": "^9.0.0", | ||
"unified": "^10.0.0" | ||
"@types/hast": "^3.0.0", | ||
"rehype-parse": "^9.0.0", | ||
"rehype-stringify": "^10.0.0", | ||
"unified": "^11.0.0" | ||
}, | ||
@@ -38,4 +38,3 @@ "homepage": "https://github.com/rehypejs/rehype", | ||
"type": "module", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"exports": "./index.js", | ||
"files": [ | ||
@@ -45,5 +44,3 @@ "index.d.ts", | ||
], | ||
"scripts": { | ||
"build": "rimraf \"*.d.ts\" && tsc && type-coverage" | ||
}, | ||
"scripts": {}, | ||
"xo": false, | ||
@@ -50,0 +47,0 @@ "typeCoverage": { |
@@ -11,4 +11,4 @@ # rehype | ||
**[unified][]** processor with support for parsing HTML input and serializing | ||
HTML as output. | ||
**[unified][]** processor to add support for parsing from HTML and serializing | ||
to HTML. | ||
@@ -36,3 +36,3 @@ ## Contents | ||
This package is a [unified][] processor with support for parsing HTML input | ||
This package is a [unified][] processor with support for parsing HTML as input | ||
and serializing HTML as output by using unified with | ||
@@ -63,3 +63,3 @@ [`rehype-parse`][rehype-parse] and [`rehype-stringify`][rehype-stringify]. | ||
This package is [ESM only][esm]. | ||
In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]: | ||
In Node.js (version 16+), install with [npm][]: | ||
@@ -70,13 +70,13 @@ ```sh | ||
In Deno with [Skypack][]: | ||
In Deno with [`esm.sh`][esmsh]: | ||
```js | ||
import {rehype} from 'https://cdn.skypack.dev/rehype@12?dts' | ||
import {rehype} from 'https://esm.sh/rehype@13' | ||
``` | ||
In browsers with [Skypack][]: | ||
In browsers with [`esm.sh`][esmsh]: | ||
```html | ||
<script type="module"> | ||
import {rehype} from 'https://cdn.skypack.dev/rehype@12?min' | ||
import {rehype} from 'https://esm.sh/rehype@13?bundle' | ||
</script> | ||
@@ -93,8 +93,3 @@ ``` | ||
main() | ||
async function main() { | ||
const file = await rehype() | ||
.use(rehypeFormat) | ||
.process(`<!doctype html> | ||
const file = await rehype().use(rehypeFormat).process(`<!doctype html> | ||
<html lang=en> | ||
@@ -109,4 +104,3 @@ <head> | ||
console.error(String(file)) | ||
} | ||
console.error(String(file)) | ||
``` | ||
@@ -130,3 +124,3 @@ | ||
This package exports the following identifier: `rehype`. | ||
This package exports the identifier [`rehype`][api-rehype]. | ||
There is no default export. | ||
@@ -136,4 +130,6 @@ | ||
Create a new (unfrozen) unified processor that already uses `rehype-parse` and | ||
`rehype-stringify` and you can add more plugins to. | ||
Create a new unified processor that already uses | ||
[`rehype-parse`][rehype-parse] and [`rehype-stringify`][rehype-stringify]. | ||
You can add more plugins with `use`. | ||
See [`unified`][unified] for more information. | ||
@@ -146,3 +142,3 @@ | ||
When you use `rehype-parse` or `rehype-stringify` manually you can pass options | ||
to `use`. | ||
directly to them with `use`. | ||
Because both plugins are already used in `rehype`, that’s not possible. | ||
@@ -152,15 +148,15 @@ To define options for them, you can instead pass options to `data`: | ||
```js | ||
import {rehype} from 'rehype' | ||
import {reporter} from 'vfile-reporter' | ||
import {rehype} from 'rehype' | ||
main() | ||
const file = await rehype() | ||
.data('settings', { | ||
emitParseErrors: true, | ||
fragment: true, | ||
preferUnquoted: true | ||
}) | ||
.process('<div title="a" title="b"></div>') | ||
async function main() { | ||
const file = await rehype() | ||
.data('settings', {fragment: true, emitParseErrors: true, preferUnquoted: true}) | ||
.process('<div title="a" title="b"></div>') | ||
console.error(reporter(file)) | ||
console.log(String(file)) | ||
} | ||
console.error(reporter(file)) | ||
console.log(String(file)) | ||
``` | ||
@@ -171,3 +167,3 @@ | ||
```txt | ||
1:21-1:21 warning Unexpected duplicate attribute duplicate-attribute parse-error | ||
1:21-1:21 warning Unexpected duplicate attribute duplicate-attribute hast-util-from-html | ||
@@ -183,4 +179,4 @@ ⚠ 1 warning | ||
HTML is parsed according to WHATWG HTML (the living standard), which is also | ||
followed by browsers such as Chrome and Firefox. | ||
HTML is parsed and serialized according to WHATWG HTML (the living standard), | ||
which is also followed by all browsers. | ||
@@ -194,11 +190,14 @@ ## Syntax tree | ||
This package is fully typed with [TypeScript][]. | ||
There are no extra types exported. | ||
It exports no additional types. | ||
## Compatibility | ||
Projects maintained by the unified collective are compatible with all maintained | ||
Projects maintained by the unified collective are compatible with maintained | ||
versions of Node.js. | ||
As of now, that is Node.js 12.20+, 14.14+, and 16.0+. | ||
Our projects sometimes work with older versions, but this is not guaranteed. | ||
When we cut a new major release, we drop support for unmaintained versions of | ||
Node. | ||
This means we try to keep the current release line, `rehype@^13`, compatible | ||
with Node.js 16. | ||
## Security | ||
@@ -229,4 +228,2 @@ | ||
<!--lint ignore no-html--> | ||
<table> | ||
@@ -280,2 +277,6 @@ <tr valign="middle"> | ||
<td width="10%" align="center"> | ||
<a href="https://markdown.space">Markdown Space</a><br><br> | ||
<a href="https://markdown.space"><img src="https://images.opencollective.com/markdown-space/e1038ed/logo/128.png" width="64"></a> | ||
</td> | ||
<td width="10%" align="center"> | ||
<a href="https://www.holloway.com">Holloway</a><br><br> | ||
@@ -286,3 +287,2 @@ <a href="https://www.holloway.com"><img src="https://avatars1.githubusercontent.com/u/35904294?s=128&v=4" width="64"></a> | ||
<td width="10%"></td> | ||
<td width="10%"></td> | ||
</tr> | ||
@@ -316,5 +316,5 @@ <tr valign="middle"> | ||
[size-badge]: https://img.shields.io/bundlephobia/minzip/rehype.svg | ||
[size-badge]: https://img.shields.io/bundlejs/size/rehype | ||
[size]: https://bundlephobia.com/result?p=rehype | ||
[size]: https://bundlejs.com/?q=rehype | ||
@@ -349,3 +349,3 @@ [sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg | ||
[skypack]: https://www.skypack.dev | ||
[esmsh]: https://esm.sh | ||
@@ -371,1 +371,3 @@ [unified]: https://github.com/unifiedjs/unified | ||
[rehype-dom]: https://github.com/rehypejs/rehype-dom/tree/main/packages/rehype-dom | ||
[api-rehype]: #rehype-1 |
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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
12120
13
355
0
+ Added@types/hast@3.0.4(transitive)
+ Added@types/mdast@4.0.4(transitive)
+ Added@types/unist@3.0.3(transitive)
+ Added@ungap/structured-clone@1.2.0(transitive)
+ Addeddequal@2.0.3(transitive)
+ Addeddevlop@1.1.0(transitive)
+ Addedentities@4.5.0(transitive)
+ Addedhast-util-from-html@2.0.3(transitive)
+ Addedhast-util-from-parse5@8.0.1(transitive)
+ Addedhast-util-parse-selector@4.0.0(transitive)
+ Addedhast-util-to-html@9.0.3(transitive)
+ Addedhast-util-whitespace@3.0.0(transitive)
+ Addedhastscript@8.0.0(transitive)
+ Addedhtml-void-elements@3.0.0(transitive)
+ Addedmdast-util-to-hast@13.2.0(transitive)
+ Addedmicromark-util-character@2.1.0(transitive)
+ Addedmicromark-util-encode@2.0.0(transitive)
+ Addedmicromark-util-sanitize-uri@2.0.0(transitive)
+ Addedmicromark-util-symbol@2.0.0(transitive)
+ Addedmicromark-util-types@2.0.0(transitive)
+ Addedparse5@7.2.1(transitive)
+ Addedrehype-parse@9.0.1(transitive)
+ Addedrehype-stringify@10.0.1(transitive)
+ Addedtrim-lines@3.0.1(transitive)
+ Addedunified@11.0.5(transitive)
+ Addedunist-util-is@6.0.0(transitive)
+ Addedunist-util-position@5.0.0(transitive)
+ Addedunist-util-stringify-position@4.0.0(transitive)
+ Addedunist-util-visit@5.0.0(transitive)
+ Addedunist-util-visit-parents@6.0.1(transitive)
+ Addedvfile@6.0.3(transitive)
+ Addedvfile-location@5.0.3(transitive)
+ Addedvfile-message@4.0.2(transitive)
- Removed@types/hast@2.3.10(transitive)
- Removed@types/parse5@6.0.3(transitive)
- Removed@types/unist@2.0.11(transitive)
- Removedhast-util-from-parse5@7.1.2(transitive)
- Removedhast-util-parse-selector@3.1.1(transitive)
- Removedhast-util-raw@7.2.3(transitive)
- Removedhast-util-to-html@8.0.4(transitive)
- Removedhast-util-to-parse5@7.1.0(transitive)
- Removedhast-util-whitespace@2.0.1(transitive)
- Removedhastscript@7.2.0(transitive)
- Removedhtml-void-elements@2.0.1(transitive)
- Removedis-buffer@2.0.5(transitive)
- Removedparse5@6.0.1(transitive)
- Removedrehype-parse@8.0.5(transitive)
- Removedrehype-stringify@9.0.4(transitive)
- Removedunified@10.1.2(transitive)
- Removedunist-util-is@5.2.1(transitive)
- Removedunist-util-position@4.0.4(transitive)
- Removedunist-util-stringify-position@3.0.3(transitive)
- Removedunist-util-visit@4.1.2(transitive)
- Removedunist-util-visit-parents@5.1.3(transitive)
- Removedvfile@5.3.7(transitive)
- Removedvfile-location@4.1.0(transitive)
- Removedvfile-message@3.1.4(transitive)
Updated@types/hast@^3.0.0
Updatedrehype-parse@^9.0.0
Updatedrehype-stringify@^10.0.0
Updatedunified@^11.0.0