rehype-format
Advanced tools
Comparing version 2.3.2 to 3.0.0
{ | ||
"name": "rehype-format", | ||
"version": "2.3.2", | ||
"version": "3.0.0", | ||
"description": "rehype plugin to format HTML", | ||
@@ -27,5 +27,5 @@ "license": "MIT", | ||
"html-whitespace-sensitive-tag-names": "^1.0.0", | ||
"rehype-minify-whitespace": "^2.0.0", | ||
"rehype-minify-whitespace": "^3.0.0", | ||
"repeat-string": "^1.5.4", | ||
"unist-util-visit-parents": "^2.0.0" | ||
"unist-util-visit-parents": "^3.0.0" | ||
}, | ||
@@ -39,5 +39,5 @@ "devDependencies": { | ||
"prettier": "^1.0.0", | ||
"rehype": "^7.0.0", | ||
"remark-cli": "^6.0.0", | ||
"remark-preset-wooorm": "^5.0.0", | ||
"rehype": "^9.0.0", | ||
"remark-cli": "^7.0.0", | ||
"remark-preset-wooorm": "^6.0.0", | ||
"tape": "^4.0.0", | ||
@@ -44,0 +44,0 @@ "tinyify": "^2.0.0", |
@@ -55,4 +55,7 @@ # rehype-format | ||
```txt | ||
index.html: no issues found | ||
``` | ||
```html | ||
index.html: no issues found | ||
<!doctype html> | ||
@@ -76,10 +79,10 @@ <html> | ||
Format white-space in the processed tree. | ||
Format white space in the processed tree. | ||
* Collapse all white-space (to a single space or newline) | ||
* Remove unneeded white-space | ||
* Collapse all white space (to a single space or newline) | ||
* Remove unneeded white space | ||
* Inject needed newlines and indentation | ||
* Indent previously collapsed newlines properly | ||
All superfluous white-space is removed. | ||
All superfluous white space is removed. | ||
However, as newlines are kept (and later properly indented), your code will | ||
@@ -108,2 +111,10 @@ still line-wrap as expected. | ||
## Security | ||
Use of `rehype-format` changes white space in the syntax tree. | ||
White space in `<script>`, `<style>`, `<pre>`, or `<textarea>` is not modified. | ||
If the tree is already safe, use of this plugin does not open you up for a | ||
[cross-site scripting (XSS)][xss] attack. | ||
When in doubt, use [`rehype-sanitize`][sanitize]. | ||
## Related | ||
@@ -113,2 +124,10 @@ | ||
— Minify HTML | ||
* [`rehype-document`](https://github.com/rehypejs/rehype-document) | ||
— Wrap a document around a fragment | ||
* [`rehype-sanitize`](https://github.com/rehypejs/rehype-sanitize) | ||
— Sanitize HTML | ||
* [`rehype-toc`](https://github.com/JS-DevTools/rehype-toc) | ||
— Add a table of contents (TOC) | ||
* [`rehype-section`](https://github.com/agentofuser/rehype-section) | ||
— Wrap headings and their contents in sections | ||
@@ -172,1 +191,5 @@ ## Contribute | ||
[rehype]: https://github.com/rehypejs/rehype | ||
[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting | ||
[sanitize]: https://github.com/rehypejs/rehype-sanitize |
11202
191
+ Added@types/unist@2.0.10(transitive)
+ Addedrehype-minify-whitespace@3.0.0(transitive)
+ Addedunist-util-is@4.1.0(transitive)
+ Addedunist-util-visit-parents@3.1.1(transitive)
- Removedrehype-minify-whitespace@2.0.4(transitive)
- Removedunist-util-is@3.0.0(transitive)
- Removedunist-util-visit-parents@2.1.2(transitive)