Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: algolia/diffable-html
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.0.0
Choose a base ref
...
head repository: algolia/diffable-html
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.0.0
Choose a head ref
  • 4 commits
  • 5 files changed
  • 2 contributors

Commits on Oct 19, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    adeb534 View commit details

Commits on Oct 12, 2022

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    eb5b363 View commit details

Commits on Feb 13, 2025

  1. chore(deps): bump htmlparser2 from 3.9.2 to 5.0.1 (#55)

    * chore(deps): bump htmlparser2 from 3.9.2 to 5.0.0
    
    * chore(deps): bump htmlparser2 from 5.0.0 to 5.0.1
    
    * Apply suggestions from code review
    
    ---------
    
    Co-authored-by: Haroen Viaene <hello@haroen.me>
    jacobjmarks and Haroenv authored Feb 13, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d547e64 View commit details

Commits on Feb 15, 2025

  1. chore(release): v6.0.0 (#56)

    Haroenv authored Feb 15, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    ac53418 View commit details
Showing with 75 additions and 103 deletions.
  1. +27 −36 CHANGELOG.md
  2. +3 −2 README.md
  3. +1 −8 index.js
  4. +2 −2 package.json
  5. +42 −55 yarn.lock
63 changes: 27 additions & 36 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,93 +1,84 @@
<a name="5.0.0"></a>
# [5.0.0](https://github.com/rayrutjes/diffable-html/compare/v4.1.0...v5.0.0) (2021-10-19)
<a name="6.0.0"></a>

# [6.0.0](https://github.com/rayrutjes/diffable-html/compare/v4.1.0...v6.0.0) (2025-02-13)

### Features

* update attribute formatting ([#45](https://github.com/rayrutjes/diffable-html/issues/45)) ([69120ea](https://github.com/rayrutjes/diffable-html/commit/69120ea))
- update attribute formatting ([#45](https://github.com/rayrutjes/diffable-html/issues/45)) ([69120ea](https://github.com/rayrutjes/diffable-html/commit/69120ea))

<a name="5.0.0"></a>

# [5.0.0](https://github.com/rayrutjes/diffable-html/compare/v4.1.0...v5.0.0) (2021-10-19)

<a name="4.1.0"></a>
# [4.1.0](https://github.com/rayrutjes/diffable-html/compare/v4.0.0...v4.1.0) (2021-07-13)
### Features

- update attribute formatting ([#45](https://github.com/rayrutjes/diffable-html/issues/45)) ([69120ea](https://github.com/rayrutjes/diffable-html/commit/69120ea))

### Features
<a name="4.1.0"></a>

* add sortAttributes option ([#40](https://github.com/rayrutjes/diffable-html/issues/40)) ([4b66987](https://github.com/rayrutjes/diffable-html/commit/4b66987))
# [4.1.0](https://github.com/rayrutjes/diffable-html/compare/v4.0.0...v4.1.0) (2021-07-13)

### Features

- add sortAttributes option ([#40](https://github.com/rayrutjes/diffable-html/issues/40)) ([4b66987](https://github.com/rayrutjes/diffable-html/commit/4b66987))

<a name="4.0.0"></a>
# [4.0.0](https://github.com/rayrutjes/diffable-html/compare/v3.0.0...v4.0.0) (2018-12-31)

# [4.0.0](https://github.com/rayrutjes/diffable-html/compare/v3.0.0...v4.0.0) (2018-12-31)

### Bug Fixes

* trim space characters but not Unicode whitespace ([bade75d](https://github.com/rayrutjes/diffable-html/commit/bade75d)), closes [#14](https://github.com/rayrutjes/diffable-html/issues/14)


- trim space characters but not Unicode whitespace ([bade75d](https://github.com/rayrutjes/diffable-html/commit/bade75d)), closes [#14](https://github.com/rayrutjes/diffable-html/issues/14)

<a name="3.0.0"></a>
# [3.0.0](https://github.com/rayrutjes/diffable-html/compare/v2.1.0...v3.0.0) (2018-01-03)

# [3.0.0](https://github.com/rayrutjes/diffable-html/compare/v2.1.0...v3.0.0) (2018-01-03)

### Features

* remove HTML comments ([ed9b793](https://github.com/rayrutjes/diffable-html/commit/ed9b793))


- remove HTML comments ([ed9b793](https://github.com/rayrutjes/diffable-html/commit/ed9b793))

<a name="2.1.0"></a>
# [2.1.0](https://github.com/rayrutjes/diffable-html/compare/v2.0.1...v2.1.0) (2017-05-27)

# [2.1.0](https://github.com/rayrutjes/diffable-html/compare/v2.0.1...v2.1.0) (2017-05-27)

### Features

* **xml:** handle self closing tags as real tags ([e9f80d0](https://github.com/rayrutjes/diffable-html/commit/e9f80d0))


- **xml:** handle self closing tags as real tags ([e9f80d0](https://github.com/rayrutjes/diffable-html/commit/e9f80d0))

<a name="2.0.1"></a>
## [2.0.1](https://github.com/rayrutjes/diffable-html/compare/v2.0.0...v2.0.1) (2017-05-18)

## [2.0.1](https://github.com/rayrutjes/diffable-html/compare/v2.0.0...v2.0.1) (2017-05-18)

### Bug Fixes

* **build:** add the missing build ([eee0b47](https://github.com/rayrutjes/diffable-html/commit/eee0b47))


- **build:** add the missing build ([eee0b47](https://github.com/rayrutjes/diffable-html/commit/eee0b47))

<a name="2.0.0"></a>
# [2.0.0](https://github.com/rayrutjes/diffable-html/compare/v1.0.0...v2.0.0) (2017-05-18)

# [2.0.0](https://github.com/rayrutjes/diffable-html/compare/v1.0.0...v2.0.0) (2017-05-18)

### Features

* **directives:** add support for directives ([c86f99e](https://github.com/rayrutjes/diffable-html/commit/c86f99e))

- **directives:** add support for directives ([c86f99e](https://github.com/rayrutjes/diffable-html/commit/c86f99e))

### Bug Fixes

* **attributes:** do not display right side of empty attributes ([c86f99e](https://github.com/rayrutjes/diffable-html/commit/c86f99e))
* **tags:** do not automatically lower case tag names ([c86f99e](https://github.com/rayrutjes/diffable-html/commit/c86f99e))


- **attributes:** do not display right side of empty attributes ([c86f99e](https://github.com/rayrutjes/diffable-html/commit/c86f99e))
- **tags:** do not automatically lower case tag names ([c86f99e](https://github.com/rayrutjes/diffable-html/commit/c86f99e))

<a name="1.0.0"></a>
# [1.0.0](https://github.com/rayrutjes/diffable-html/compare/v0.2.0...v1.0.0) (2017-04-18)


# [1.0.0](https://github.com/rayrutjes/diffable-html/compare/v0.2.0...v1.0.0) (2017-04-18)

<a name="0.2.0"></a>
# [0.2.0](https://github.com/rayrutjes/diffable-html/compare/v0.1.0...v0.2.0) (2017-04-18)

# [0.2.0](https://github.com/rayrutjes/diffable-html/compare/v0.1.0...v0.2.0) (2017-04-18)

### Bug Fixes

* **build:** export dist folder ([0841b9c](https://github.com/rayrutjes/diffable-html/commit/0841b9c))


- **build:** export dist folder ([0841b9c](https://github.com/rayrutjes/diffable-html/commit/0841b9c))

<a name="0.1.0"></a>

# 0.1.0 (2017-04-18)
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -53,8 +53,9 @@ Will output:
<h1>
Hello World!
</h1>
<ul id="main-list"
class="list"
<ul
id="main-list"
class="list"
>
<li>
<a href="#">
9 changes: 1 addition & 8 deletions index.js
Original file line number Diff line number Diff line change
@@ -80,14 +80,6 @@ const format = function(html, { sortAttributes = names => names } = {}) {
append(closeWith);
};

const getAttributeAsString = (name, value) => {
if (value.length === 0) {
return name;
}

return `${name}="${value}"`;
};

const appendAttribute = (name, value) => {
let attribute = ' ' + name;

@@ -237,6 +229,7 @@ const format = function(html, { sortAttributes = names => names } = {}) {
{
lowerCaseTags: false,
recognizeSelfClosing: true,
decodeEntities: false,
}
);
parser.write(html);
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "diffable-html",
"version": "5.0.0",
"version": "6.0.0",
"description": "Opinionated HTML formatter focused towards making HTML diffs readable.",
"main": "dist/diffable-html.js",
"author": "Raymond RUTJES <raymond.rutjes@gmail.com> (https://github.com/rayrutjes/)",
@@ -40,7 +40,7 @@
},
"homepage": "https://github.com/rayrutjes/diffable-html#readme",
"dependencies": {
"htmlparser2": "^3.9.2"
"htmlparser2": "^5.0.1"
},
"devDependencies": {
"babel-jest": "^19.0.0",
97 changes: 42 additions & 55 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -638,10 +638,6 @@ buble@^0.15.0:
minimist "^1.2.0"
os-homedir "^1.0.1"

buffer-shims@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51"

builtin-modules@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
@@ -954,33 +950,42 @@ diff@^3.0.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12"

dom-serializer@0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82"
dom-serializer@^1.0.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.4.1.tgz#de5d41b1aea290215dc45a6dae8adcf1d32e2d30"
integrity sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==
dependencies:
domelementtype "~1.1.1"
entities "~1.1.1"
domelementtype "^2.0.1"
domhandler "^4.2.0"
entities "^2.0.0"

domelementtype@1, domelementtype@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.0.tgz#b17aed82e8ab59e52dd9c19b1756e0fc187204c2"
domelementtype@^2.0.1, domelementtype@^2.2.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d"
integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==

domelementtype@~1.1.1:
version "1.1.3"
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b"
domhandler@^3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-3.3.0.tgz#6db7ea46e4617eb15cf875df68b2b8524ce0037a"
integrity sha512-J1C5rIANUbuYK+FuFL98650rihynUOEzRLxW+90bKZRWB6A1X1Tf82GxR1qAWLyfNPRvjqfip3Q5tdYlmAa9lA==
dependencies:
domelementtype "^2.0.1"

domhandler@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.3.0.tgz#2de59a0822d5027fabff6f032c2b25a2a8abe738"
domhandler@^4.2.0:
version "4.3.1"
resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.3.1.tgz#8d792033416f59d68bc03a5aa7b018c1ca89279c"
integrity sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==
dependencies:
domelementtype "1"
domelementtype "^2.2.0"

domutils@^1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf"
domutils@^2.4.2:
version "2.8.0"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135"
integrity sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==
dependencies:
dom-serializer "0"
domelementtype "1"
dom-serializer "^1.0.1"
domelementtype "^2.2.0"
domhandler "^4.2.0"

dot-prop@^3.0.0:
version "3.0.0"
@@ -995,9 +1000,10 @@ ecc-jsbn@~0.1.1:
jsbn "~0.1.0"
safer-buffer "^2.1.0"

entities@^1.1.1, entities@~1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0"
entities@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55"
integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==

"errno@>=0.1.1 <0.2.0-0":
version "0.1.4"
@@ -1305,16 +1311,15 @@ html-encoding-sniffer@^1.0.1:
dependencies:
whatwg-encoding "^1.0.1"

htmlparser2@^3.9.2:
version "3.9.2"
resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.9.2.tgz#1bdf87acca0f3f9e53fa4fcceb0f4b4cbb00b338"
htmlparser2@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-5.0.1.tgz#7daa6fc3e35d6107ac95a4fc08781f091664f6e7"
integrity sha512-vKZZra6CSe9qsJzh0BjBGXo8dvzNsq/oGvsjfRdOrrryfeD9UOBEEQdeoqCRmKZchF5h2zOBMQ6YuQ0uRUmdbQ==
dependencies:
domelementtype "^1.3.0"
domhandler "^2.3.0"
domutils "^1.5.1"
entities "^1.1.1"
inherits "^2.0.1"
readable-stream "^2.0.2"
domelementtype "^2.0.1"
domhandler "^3.3.0"
domutils "^2.4.2"
entities "^2.0.0"

http-signature@~1.1.0:
version "1.1.1"
@@ -1341,7 +1346,7 @@ inflight@^1.0.4:
once "^1.3.0"
wrappy "1"

inherits@2, inherits@^2.0.1, inherits@~2.0.1, inherits@~2.0.3:
inherits@2, inherits@~2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"

@@ -2227,18 +2232,6 @@ read-pkg@^1.0.0, read-pkg@^1.1.0:
normalize-package-data "^2.3.2"
path-type "^1.0.0"

readable-stream@^2.0.2:
version "2.2.9"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.9.tgz#cf78ec6f4a6d1eb43d26488cac97f042e74b7fc8"
dependencies:
buffer-shims "~1.0.0"
core-util-is "~1.0.0"
inherits "~2.0.1"
isarray "~1.0.0"
process-nextick-args "~1.0.6"
string_decoder "~1.0.0"
util-deprecate "~1.0.1"

readable-stream@^2.1.5:
version "2.3.3"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c"
@@ -2534,12 +2527,6 @@ string-width@^1.0.1, string-width@^1.0.2:
is-fullwidth-code-point "^1.0.0"
strip-ansi "^3.0.0"

string_decoder@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.0.tgz#f06f41157b664d86069f84bdbdc9b0d8ab281667"
dependencies:
buffer-shims "~1.0.0"

string_decoder@~1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab"