Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

rehype-format

Package Overview
Dependencies
14
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.3.2 to 3.0.0

12

package.json
{
"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
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc