Closed pyxide closed 2 years ago
Hello @pyxide,
This fix is essential for a project we are working on. Thank you!
I hope the pull request is about to be published soon!
Define a global variant may not be a good idea.
I tried add this new features base on this pr. and new version v5.4.0
is released to npm.
I checked issues not so often because our gov is blocking us. but I will try to keeps this lib going on though.
Thank you all very much, and @nonara always.
Hi @taoqf ,
thank you for the merging of this PR. I am not a fan of global variable either. I am on vacation right now, but I will take time to look at the code, and I will revisit this issue with a better solution based on test units. Have a nice day.
Hi,
I have added two options to format the serialization of void tags (e.g.
br
,link
), the use case was comparing two states of a HTML document, before and after DOM transformations, it was generating noise in the diff.The configuration can be set with environment variables :
Then options if present will override them each time
parse
is called:I don’t like to use global variables to set contextual data, but I cannot find an easy way to pass the options when doing serialisation. It should be propagated from the root element, or passed and dispatched when calling
toString
.