Socket
Socket
Sign inDemoInstall

rehype-format

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rehype-format - npm Package Compare versions

Comparing version 2.3.0 to 2.3.1

license

8

index.js

@@ -12,3 +12,2 @@ 'use strict'

/* Constants. */
var double = '\n\n'

@@ -18,3 +17,2 @@ var single = '\n'

/* Format white-space. */
function format(options) {

@@ -30,3 +28,3 @@ var settings = options || {}

/* Default to indenting the initial level. */
// Default to indenting the initial level.
if (indentInitial === null || indentInitial === undefined) {

@@ -64,3 +62,3 @@ indentInitial = true

/* Don’t indent content of whitespace-sensitive nodes / inlines. */
// Don’t indent content of whitespace-sensitive nodes / inlines.
if (!length || !padding(node, head) || ignore(parents.concat(node))) {

@@ -74,3 +72,3 @@ return

/* Indent newlines in `text`. */
// Indent newlines in `text`.
while (++index < length) {

@@ -77,0 +75,0 @@ child = children[index]

{
"name": "rehype-format",
"version": "2.3.0",
"version": "2.3.1",
"description": "Format HTML with rehype",

@@ -15,5 +15,5 @@ "license": "MIT",

"bugs": "https://github.com/rehypejs/rehype-format/issues",
"author": "Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)",
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)"
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],

@@ -29,3 +29,3 @@ "files": [

"repeat-string": "^1.5.4",
"unist-util-visit-parents": "^1.0.0"
"unist-util-visit-parents": "^2.0.0"
},

@@ -37,6 +37,6 @@ "devDependencies": {

"negate": "^1.0.0",
"nyc": "^12.0.0",
"nyc": "^13.0.0",
"prettier": "^1.13.7",
"rehype": "^6.0.0",
"remark-cli": "^5.0.0",
"remark-cli": "^6.0.0",
"remark-preset-wooorm": "^4.0.0",

@@ -46,8 +46,8 @@ "tape": "^4.0.0",

"to-vfile": "^5.0.0",
"xo": "^0.21.0"
"xo": "^0.23.0"
},
"scripts": {
"format": "remark . -qfo && prettier --write '**/*.js' && xo --fix",
"build-bundle": "browserify index.js -s rehypeFormat > rehype-format.js",
"build-mangle": "browserify index.js -s rehypeFormat -p tinyify > rehype-format.min.js",
"build-bundle": "browserify . -s rehypeFormat > rehype-format.js",
"build-mangle": "browserify . -s rehypeFormat -p tinyify > rehype-format.min.js",
"build": "npm run build-bundle && npm run build-mangle",

@@ -54,0 +54,0 @@ "test-api": "node test",

@@ -1,3 +0,8 @@

# rehype-format [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov]
# rehype-format
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Chat][chat-badge]][chat]
Format HTML with [**rehype**][rehype].

@@ -32,11 +37,13 @@

```javascript
var vfile = require('to-vfile');
var report = require('vfile-reporter');
var rehype = require('rehype');
var format = require('rehype-format');
var vfile = require('to-vfile')
var report = require('vfile-reporter')
var rehype = require('rehype')
var format = require('rehype-format')
rehype().use(format).process(vfile.readSync('index.html'), function (err, file) {
console.error(report(err || file));
console.log(String(file));
});
rehype()
.use(format)
.process(vfile.readSync('index.html'), function(err, file) {
console.error(report(err || file))
console.log(String(file))
})
```

@@ -117,15 +124,23 @@

[travis-badge]: https://img.shields.io/travis/rehypejs/rehype-format.svg
[build-badge]: https://img.shields.io/travis/rehypejs/rehype-format.svg
[travis]: https://travis-ci.org/rehypejs/rehype-format
[build]: https://travis-ci.org/rehypejs/rehype-format
[codecov-badge]: https://img.shields.io/codecov/c/github/rehypejs/rehype-format.svg
[coverage-badge]: https://img.shields.io/codecov/c/github/rehypejs/rehype-format.svg
[codecov]: https://codecov.io/github/rehypejs/rehype-format
[coverage]: https://codecov.io/github/rehypejs/rehype-format
[downloads-badge]: https://img.shields.io/npm/dm/rehype-format.svg
[downloads]: https://www.npmjs.com/package/rehype-format
[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
[chat]: https://spectrum.chat/unified/rehype
[npm]: https://docs.npmjs.com/cli/install
[license]: LICENSE
[license]: license
[author]: http://wooorm.com
[author]: https://wooorm.com

@@ -132,0 +147,0 @@ [rehype]: https://github.com/rehypejs/rehype

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