``` javascript
The fromHTML function was replaced by html in 2.0.0. Unfortunately, the typings currently still contain the fromHTML method but a fix is under way.
thanks @HackbrettXXX
@HackbrettXXX why was this change made !!! From my perspective a junior dev move !!!
A lot of people are struggling with this and code gets broken.
@kamildudek6 simple to explain: In [email protected] there were _4_ different functions to convert HTML to PDF (fromHTML, addHTML, html2pdf, and html). Each had its own API and feature set. It was quite confusing for developers to decide which function to use. Since html had the most complete feature set and the most promising technological approach, it was chosen as the single HTML function for 2.0.0. The others were already marked as deprecated in 1.5.x. Between 1.5.3 and 2.0.0 developers had almost _two_ years to port their code to html. Since a new major release with other breaking changes was already planned, it was only logical to remove all the old deprecated functions.
Another big point is maintenance and support. This project is currently maintained by a _single_ person (me), and it is just not feasible to maintain 4 different variants of HTML functions, all with their own bugs and missing features. I hardly have the time maintain one of them properly. Please keep in mind this is an open source project, which everyone can use _for free_.
And, lastly, if you really want to use one of the old HTML functions, no one keeps you from installing 1.5.3 again or even forking the project and merge the old function with the 2.x code.
Also, please refrain from phrases like "junior dev move" if you don't know the details behind design decisions. That's not very kind and, IMHO, GitHub is not the right place for that. IMO, conversations on GitHub should remain purely technical and not emotional.
Most helpful comment
The
fromHTMLfunction was replaced byhtmlin 2.0.0. Unfortunately, the typings currently still contain thefromHTMLmethod but a fix is under way.