Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

html-format

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-format - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

11

index.js

@@ -54,2 +54,4 @@ const tagName = String.raw`[^/\s>]+`;

"base",
"basefont",
"bgsound",
"br",

@@ -59,3 +61,5 @@ "col",

"embed",
"frame",
"hr",
"image",
"img",

@@ -65,3 +69,2 @@ "input",

"link",
"menuitem",
"meta",

@@ -145,5 +148,2 @@ "param",

if (["pre", "script", "style"].includes(tagName))
specialElement = tagName;
++level;

@@ -208,2 +208,5 @@

if (["pre", "script", "style"].includes(tagName))
specialElement = tagName;
if (selfClosing) --level;

@@ -210,0 +213,0 @@ }

{
"name": "html-format",
"version": "1.1.0",
"version": "1.1.1",
"description": "Format HTML strings.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,3 +0,2 @@

html-format
===========
# html-format

@@ -7,16 +6,14 @@ Format HTML strings by indenting, wrapping, and removing unnecessary

Install
-------
## Install
npm install html-format
Usage
-----
## Usage
```javascript
const format = require('html-format');
import format from "html-format";
const html = `\
<body>
<main class="bg"> </main>
<main class="grid"> </main>
</body>

@@ -26,5 +23,6 @@ `;

// indent = 2 spaces (default), width = 80 characters (default)
format(html) == `\
format(html) ==
`\
<body>
<main class="bg"> </main>
<main class="grid"> </main>
</body>

@@ -34,5 +32,6 @@ `;

// indent = 4 spaces, width = 80 characters (default)
format(html, ' '.repeat(4)) == `\
format(html, " ".repeat(4)) ==
`\
<body>
<main class="bg"> </main>
<main class="grid"> </main>
</body>

@@ -42,6 +41,7 @@ `;

// indent = 4 spaces, width = 20 characters
format(html, ' '.repeat(4), 20) == `\
format(html, " ".repeat(4), 20) ==
`\
<body>
<main
class="bg">
class="grid">
</main>

@@ -48,0 +48,0 @@ </body>

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