Skip to content

Conversation

raffazizzi
Copy link
Collaborator

@raffazizzi raffazizzi commented Feb 20, 2025

Replaced XPath with evaluate() in preprocess() with DOM methods. The code calculates the data-level attribute based on ancestor::*[head].

This wasn't working properly, at least with JSDOM; it always returned 0. I am getting more reasonable results with DOM methods.

The main motivation for doing this, however, is to allow compatibility with other DOM implemntations/emulators besides JSDOM, such as linkedom and happy-dom.

Also updated dependencies (had to switch out the terser plugin and babel-preset-env)

@raffazizzi raffazizzi requested a review from hcayless February 20, 2025 17:08
@hcayless hcayless merged commit 80150a6 into master Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants