Skip to content
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

Option to return un-stringified elements for use in plugins and other libraries #442

Open
josh-hemphill opened this issue Oct 29, 2023 · 3 comments · May be fixed by #443
Open

Option to return un-stringified elements for use in plugins and other libraries #442

josh-hemphill opened this issue Oct 29, 2023 · 3 comments · May be fixed by #443

Comments

@josh-hemphill
Copy link

When writing front-end tooling plugins, I need to track the individual tags/elements and their attributes for when html regenerates.

I think the easiest thing to do would be to make it possible to get back the html elements as objects.
I can probably put together a PR pretty quick, just want to see if there'd be any interest in merging first.

@andy128k
Copy link
Collaborator

That's great idea. The only concern I have is how to do this and not break existing API.

@josh-hemphill
Copy link
Author

I started experimenting, and while it took a little more modification than I thought to get the types to automatically resolve, it's still just an additional flag in the options that defaults to still returning the html as a string, so I'm not sure if there'd really be anything breaking other than maybe if some people are doing other things like re-exporting the types. 🤔

If you mean not changing the options at all, then I could expose it as a separate export maybe. 🤷

@josh-hemphill
Copy link
Author

I forked and branched with what I have so far: https://github.com/josh-hemphill/favicons/tree/html-obj-return

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants