-
Notifications
You must be signed in to change notification settings - Fork 98
Description
Hi,
I noticed that currently linkedom fails to parse styles with nested CSS rules. Here's a sample code:
import {parseHTML} from "linkedom";
const doc = parseHTML(`
<style>
.parent { .child { color: red; }}
</style>
`).document;
console.log(doc.children[0].sheet);Looking into it, it seems like this is an issue with CSSOM, which makes sense considering that project stopped receiving updates 5 years ago and is marked as unmaintained. Although I didn't check, I assume other kinds of 'modern' CSS rules will also raise an exception when parsed.
I would like to know if there is interest in replacing it with an up-to-date CSS parser implementation.
Looking online, I found a benchmark that shows that a few other CSS parsers more or less match the performance of CSSOM, which I know is an important factor for this project.
If this is desired I can take a look into changing the backing implementation, probably trying the projects in the order they appear in that benchmark (I don't know which of those provides the functionalities linkedom requires).