absurd icon indicating copy to clipboard operation
absurd copied to clipboard

Convert HTML to JSON

Open johanchouquet opened this issue 10 years ago • 4 comments

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

johanchouquet avatar Mar 31 '15 13:03 johanchouquet

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

krasimir avatar Apr 01 '15 08:04 krasimir

Hi @krasimir ,

Did you have the time to work on this enhancement ? Sure, it'd be helpfull to me.

johanchouquet avatar Aug 12 '15 12:08 johanchouquet

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.

krasimir avatar Aug 12 '15 13:08 krasimir

Thanks @krasimir , i'll take a look at it. Seems quite usefull indeed!

johanchouquet avatar Aug 17 '15 15:08 johanchouquet