Convert HTML to JSON
Hi,
Not sure it is an issue but it may be some new functionality :
I'm very interested in this library. And i'm wondering if it's possible to convert some HTML tags (the whole Body tag) to a JSON object or file, in order to migrate from 1 html template to another one. I feel that there's almost everything in this library to do just that, but i'm not seeing it right now.
Cheers
Indeed sounds like a nice feature. In the moment is not possible though. Even the client-side version of the library works with DOM nodes.
However, this may be a really nice performance boot. AbsurdJS uses the concept of the virtual DOM. I have to make some test and see if comparing JSON is faster then comparing the actual DOM trees. I mean we may transform the markup to JSON and then run the difference finder. Marking this as enhancement
Hi @krasimir ,
Did you have the time to work on this enhancement ? Sure, it'd be helpfull to me.
Hi @dargoan,
I'll try finding some time for this. In the mean time, did you try https://github.com/Jxck/html2json I used it in a personal project and it worked pretty good.
Thanks @krasimir , i'll take a look at it. Seems quite usefull indeed!