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: xmldom/xmldom
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.8.10
Choose a base ref
...
head repository: xmldom/xmldom
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.8.12
Choose a head ref
  • 16 commits
  • 17 files changed
  • 4 contributors

Commits on Aug 17, 2025

  1. ci: execute checks on 0.8.x release branch (#934)

    Since contributions regularly effect 0.8.x let's use GitHub actions to
    run the checks.
    Following the usual pattern, this is first applied to the master branch,
    before being ported to the release branch.
    
    (cherry picked from commit 39fc73e)
    karfau committed Aug 17, 2025
    Configuration menu
    Copy the full SHA
    c4dedf1 View commit details
    Browse the repository at this point in the history
  2. fix: [0.8.x] update ownerDocument when moving nodes between documen…

    …ts (#933)
    
    Resolves issue #932
    
    Co-authored-by: Christian Bewernitz <[email protected]>
    shunkica and karfau authored Aug 17, 2025
    Configuration menu
    Copy the full SHA
    cd97add View commit details
    Browse the repository at this point in the history
  3. docs: prepare changelog for 0.8.11

    and update package-lock file
    karfau committed Aug 17, 2025
    Configuration menu
    Copy the full SHA
    3562083 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    386989e View commit details
    Browse the repository at this point in the history
  5. Revert "chore: pin npm version using node 22"

    This reverts commit 386989e.
    karfau committed Aug 17, 2025
    Configuration menu
    Copy the full SHA
    4bb9a5f View commit details
    Browse the repository at this point in the history
  6. chore: bump np to version 9.2.0

    to fix issues while releasing the package using node v18
    karfau committed Aug 17, 2025
    Configuration menu
    Copy the full SHA
    5aadcdd View commit details
    Browse the repository at this point in the history
  7. 0.8.11

    karfau committed Aug 17, 2025
    Configuration menu
    Copy the full SHA
    c0f1401 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    cbf44d9 View commit details
    Browse the repository at this point in the history
  9. chore: add .nvmrc pointing to node version 18

    to use for releasing new versions
    karfau committed Aug 17, 2025
    Configuration menu
    Copy the full SHA
    cece752 View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2026

  1. fix: preserve trailing whitespace in ProcessingInstruction data (#962)

    **Target branch**: `release-0.8.x`
    
    ### What
    
    Remove `\s*` from the `parseInstruction` regex in `lib/sax.js` so that
    trailing whitespace inside a processing instruction is preserved instead
    of silently stripped.
    
    ### Why
    
    Per [XML spec §2.6](https://www.w3.org/TR/xml/#sec-pi), PI data is
    everything between the mandatory separator whitespace after the target
    and the closing `?>`. Trailing whitespace inside the PI boundary is
    content — there is no rule to strip it. Conforming parsers (sax-js,
    libexpat) preserve it.
    
    This was already fixed on `master`/`0.9.x` as a side-effect of the large
    DOCTYPE rewrite in PR #498 (22k lines). This PR is the minimal,
    non-breaking backport for the maintained `0.8.x` line.
    
    ### How
    
    `parseInstruction` builds a substring that already excludes `?>`, so `$`
    anchors immediately before it. The `\s*` before `$` was greedily
    consuming any trailing whitespace from PI data before passing it to
    `domBuilder.processingInstruction`. Removing it — while keeping `*?` on
    the data group to minimise diff — is the complete fix.
    
    ```js
    // before
    source.substring(start, end).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/)
    // after
    source.substring(start, end).match(/^<\?(\S*)\s*([\s\S]*?)$/)
    ```
    
    Five existing snapshots in
    `test/xmltest/__snapshots__/not-wf.test.js.snap` were updated: they
    captured the old buggy behaviour (trailing space stripped from
    XML-declaration-like PIs in the not-well-formed corpus). The updated
    snapshots reflect the now-correct output.
    
    ### Scope
    
    Addresses the trailing-whitespace sub-issue from #42, backporting #498
    behaviour to 0.8.x.
    stevenobiajulu authored Mar 7, 2026
    Configuration menu
    Copy the full SHA
    ac40424 View commit details
    Browse the repository at this point in the history

Commits on Mar 23, 2026

  1. chore: add local CI script and format:check script

    Add `.github/workflows/ci-local.sh` for running the full CI suite
    locally before pushing. Exports `CI=true`, validates the active Node
    version against `.nvmrc`, and runs the same steps as GitHub Actions.
    
    Also adds the `format:check` npm script used by the CI script.
    karfau committed Mar 23, 2026
    Configuration menu
    Copy the full SHA
    968c893 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ac0ac77 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4e37a20 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a5b929b View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2026

  1. fix: XML injection via unsafe CDATA serialization (GHSA-wh4c-j3r5-mjhp)…

    … (#968)
    
    Fixes GHSA-wh4c-j3r5-mjhp — XML injection via unsafe CDATA
    serialization.
    
    ### Fixed
    
    - Security: `createCDATASection` now throws `InvalidCharacterError` when
    `data` contains `"]]>"`, as required by the [WHATWG DOM
    spec](https://dom.spec.whatwg.org/#dom-document-createcdatasection).
    [`GHSA-wh4c-j3r5-mjhp`](GHSA-wh4c-j3r5-mjhp)
    - Security: `XMLSerializer` now splits CDATASection nodes whose data
    contains `"]]>"` into adjacent CDATA sections at serialization time,
    preventing XML injection via mutation methods (`appendData`,
    `replaceData`, `.data =`, `.textContent =`).
    [`GHSA-wh4c-j3r5-mjhp`](GHSA-wh4c-j3r5-mjhp)
    
    Code that passes a string containing `"]]>"` to `createCDATASection` and
    relied on the previously unsafe behavior will now receive
    `InvalidCharacterError`. Use a mutation method such as `appendData` if
    you intentionally need `"]]>"` in a CDATASection node's data.
    karfau authored Mar 29, 2026
    Configuration menu
    Copy the full SHA
    ed08df7 View commit details
    Browse the repository at this point in the history
  2. 0.8.12

    karfau committed Mar 29, 2026
    Configuration menu
    Copy the full SHA
    189cb78 View commit details
    Browse the repository at this point in the history
Loading