-
-
Notifications
You must be signed in to change notification settings - Fork 8
Support JSDOM #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Good idea! Can you work on a PR? |
sure. |
Great! |
we're using it together with remark, that turns markdown into mdast. which can be turned into hast. I want to use jsdom in the end, and currently there is no good mdast-to-dom util yet, as far as I know. |
You’re right that this is the way to go, and it’s not duplicate work if you’re not using rehype-parse. But I’m wondering why you’d want JSDOM in the end? |
I made a PR! |
Closes GH-3. Closes GH-4. Reviewed-by: Keith McKnight <[email protected]> Reviewed-by: Christian Murphy <[email protected]>
(@tripodsan and I are working on the same project) our target audience are web developers who are very familiar with the DOM APIs so that the congruence of working in MDAST vs HAST is not as valuable as giving them a familiar tool to tweak the HTML output of the process. |
Thanks for the info! That makes more sense! I believe you could also go hast -> string, string -> jsdom, I don’t think there are disadvantages of that. In the future we could also for example set |
We will probably need |
yes. that's what we did before. but it was too slow :-) We might also need support for |
Subject of the feature
When running in nodejs, the global
document
is not available. There is no way to pass in theJSDOM
document or document implementation.Problem
Without this feature, this util is useless in nodejs.
Expected behaviour
It should be possible to pass in the document via options eg:
Alternatives
non so far detected.
The text was updated successfully, but these errors were encountered: