Skip to content

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