html-format
Advanced tools
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> |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
9106
198
0