semantic-dom-diff #46
-
Hello All, I'd like to build a more extensible version of https://www.npmjs.com/package/@open-wc/semantic-dom-diff . Using rehype seams like the right path. I've written a few unified/rehype plugins to do the normalization but the last step is stringifying back to HTML. To get clean dom-diffing I need tags and attributes to be printed on individual lines like so:
This is not currently how TY |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
There was some experimental work on diffing done here: https://github.com/syntax-tree/unist-diff
I'd defer to @wooorm, I believe https://github.com/syntax-tree/hast-util-to-html/blob/46dbdd85314942221d843e24190b5a78466a0753/lib/element.js#L123-L135 would be the segment of code that would need to change. |
Beta Was this translation helpful? Give feedback.
There was some experimental work on diffing done here: https://github.com/syntax-tree/unist-diff
Still in an early phase, but something you may be able to continue/build on if your interested in going a more generalized AST route.
I'd defer to @wooorm, I believe https://github.com/syntax-tree/hast-util-to-html/blob/46dbdd85314942221d843e24190b5a78466a0753/lib/element.js#L123-L135 would be the segment of code that would…