Comparing version 3.0.0 to 3.1.0
# Changelog | ||
## v3.1.0 | ||
- Fix to normalize whitespace within text nodes | ||
## v3.0.0 | ||
- Updates Chai peer dependency to v5 | ||
- Refactors package from CommonJS to ESM | ||
## v2.1.0 | ||
@@ -11,2 +20,3 @@ | ||
- Fix for incorrect Node version reported in readme | ||
## v2.0.0 | ||
@@ -13,0 +23,0 @@ |
@@ -35,8 +35,12 @@ function attributes(attrs) { | ||
// <https://www.w3.org/TR/html4/appendix/notes.html#notes-line-breaks> | ||
if (node.nodeName === '#text' && i === 0) { | ||
node.value = node.value.replace(/^\s+/, '') | ||
} | ||
if (node.nodeName === '#text') { | ||
node.value = node.value.replace(/\s+/g, ' ') | ||
if (node.nodeName === '#text' && i === last) { | ||
node.value = node.value.replace(/\s+$/, '') | ||
if (i === 0) { | ||
node.value = node.value.replace(/^\s+/, '') | ||
} | ||
if (i === last) { | ||
node.value = node.value.replace(/\s+$/, '') | ||
} | ||
} | ||
@@ -43,0 +47,0 @@ }) |
{ | ||
"name": "chai-html", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "HTML assertions for Chai.", | ||
@@ -17,4 +17,4 @@ "keywords": [ | ||
"spec": "node --test --test-reporter spec", | ||
"lint": "eslint . --ext js", | ||
"format": "prettier --write '**/*.{js,jsx,json,yml}'", | ||
"lint": "eslint", | ||
"format": "prettier $([ $CI ] && echo '--check' || echo '--write') '**/*.{js,jsx,json,yml}'", | ||
"verify": "npm run lint && npm run format", | ||
@@ -36,8 +36,8 @@ "prepublishOnly": "npm run test" | ||
"deep-diff": "^1.0.2", | ||
"parse5": "^7.1.2" | ||
"parse5": "^7.2.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^5.0.2", | ||
"eslint": "^8.56.0", | ||
"prettier": "^3.2.4" | ||
"chai": "^5.1.2", | ||
"eslint": "^9.20.0", | ||
"prettier": "^3.5.0" | ||
}, | ||
@@ -44,0 +44,0 @@ "peerDependencies": { |
11791
192
Updatedparse5@^7.2.0