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

Separate DOM parsing and conversion #70

Closed
wants to merge 1 commit into from

Conversation

valentinbonneaud
Copy link

This PR split the convert function into two public sub-functions getDom and convertDOM. This change allows you to easily have access to the parsed Dom object outside of the library. Furthermore, the function convertDOM use a new parameter to clone the DOM before it processes it as the conversion will remove the nodes of the DOM object.

@soundasleep
Copy link
Owner

Hello, thank you for your contribution!

I'm curious as to some of the background of this change. If you wanted access to the DOM of the source, could you not directly use \DOMDocument#loadHTML and load your own DOM instance?

Or, is it that you're looking to get html2text to convert an already-loaded \DOMDocument through #convertDOM()?

@valentinbonneaud
Copy link
Author

Hi,

Thanks for your comment! Indeed, we already have the dom object loaded and we need to convert it using your #convertDOM() without reloading the dom object.

@BafS
Copy link

BafS commented Mar 3, 2020

Any new about this PR @soundasleep ?

@bartbutler
Copy link
Contributor

Superseded by #81

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.

4 participants