Leonidas-from-XIV / node-xml2js

XML to JavaScript object converter.
MIT License
4.87k stars 601 forks source link

Fix includeWhiteChars option #589

Open fkirc opened 3 years ago

fkirc commented 3 years ago

Currently, we do not receive any whitespace-characters, even if includeWhiteChars is set to true. This might be also related to https://github.com/Leonidas-from-XIV/node-xml2js/issues/582.

One more sidenote: If there is an overload of pull requests, please let me know whether this library is still maintained, or whether you are looking for a new maintainer.

coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 97.74% when pulling be5e02580181bdc95e164c682ec8844d9879faf2 on fkirc:include_whitespace into 1832e0b6b2de30a5e326d1cf21708cd32305a538 on Leonidas-from-XIV:master.

fkirc commented 3 years ago

More generally, it would be nice to have some documentation about whitespace-preservation. My use case is attranslate, a new tool to translate apps and websites: https://github.com/fkirc/attranslate For translations, we would like to modify an existing XML-file with as little changes as possible, which means to preserve whitespace and comments.

ivanzwb commented 3 years ago

Will this change merged? We also encounter this issue.

fkirc commented 3 years ago

To be honest, I believe that nothing will be merged. You could use my fork that includes this fix, which is also used by https://github.com/fkirc/attranslate. Or you could make your own fork.

Leonidas-from-XIV commented 3 years ago

If there is an overload of pull requests, please let me know whether this library is still maintained, or whether you are looking for a new maintainer.

I maintain it very sporadically. The problem with just accepting pull requests is that they add even more features which makes maintaining it even harder so I am somewhat hesitant (given the overall bad shape that the code already is in) and people often don't care about breaking things without considering that there are a ton of dependents that rely on how it is working at the moment.

Like, e.g. this PR is missing tests so whether this functionality works or not is not being evaluated in any automated way and the sheer amount of possible interactions with other options is unclear.