Skip to content

Commit 88b25c4

Browse files
authored
Merge pull request #393 from markedjs/fix-v6
2 parents 82f8e9b + 049cc7f commit 88b25c4

File tree

4 files changed

+47
-33
lines changed

4 files changed

+47
-33
lines changed

lib/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class HtmlDiffer {
4444

4545
// just pass in keys for the left and right html, the original strings are no longer used
4646
// after tokenize()
47-
const diff = htmlDiffer.diff('html1', 'html2');
47+
const diff = htmlDiffer.diff('html1', 'html2', this.options);
4848

4949
return handleMasks(diff);
5050
}
@@ -58,6 +58,10 @@ export class HtmlDiffer {
5858
* @returns {Boolean}
5959
*/
6060
async isEqual(html1, html2) {
61+
if (html1 === html2) {
62+
return true;
63+
}
64+
6165
const diff = await this.diffHtml(html1, html2);
6266

6367
return (diff.length === 1 && !diff[0].added && !diff[0].removed);

package-lock.json

Lines changed: 30 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@
3434
"parse5-sax-parser": "^7.0.0"
3535
},
3636
"devDependencies": {
37-
"@markedjs/eslint-config": "^1.0.1",
37+
"@markedjs/eslint-config": "^1.0.2",
3838
"@semantic-release/changelog": "^6.0.3",
3939
"@semantic-release/commit-analyzer": "^13.0.0",
4040
"@semantic-release/git": "^10.0.1",
41-
"@semantic-release/github": "^10.1.3",
41+
"@semantic-release/github": "^10.3.1",
4242
"@semantic-release/npm": "^12.0.1",
4343
"@semantic-release/release-notes-generator": "^14.0.1",
44-
"eslint": "^9.8.0",
44+
"eslint": "^9.9.1",
4545
"globals": "^15.9.0",
46-
"mocha": "^10.7.0",
46+
"mocha": "^10.7.3",
4747
"must": "^0.13.4",
4848
"nyc": "^17.0.0",
49-
"semantic-release": "^24.0.0"
49+
"semantic-release": "^24.1.0"
5050
},
5151
"scripts": {
5252
"test": "npm run lint && npm run unit-test && npm run func-test && npm run logger-test && npm run cover",

test/differ/isEqual.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,4 +180,11 @@ describe('\'isEqual\'', function() {
180180

181181
invalidPreset.must.throw(Error);
182182
});
183+
184+
it('blank values are equal', async function() {
185+
const htmlDiffer = new HtmlDiffer();
186+
const isEqual = await htmlDiffer.isEqual('', '');
187+
188+
isEqual.must.be.true();
189+
});
183190
});

0 commit comments

Comments
 (0)