Replies: 3 comments 1 reply
-
I believe the issue is removing new line character. As I remember, I tried to handle it in v5. if not then can incorporate. |
Beta Was this translation helpful? Give feedback.
1 reply
-
This is what I mean. |
Beta Was this translation helpful? Give feedback.
0 replies
-
closing as no response. feel free to open it for any discussion |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I propose adding a new option to
XMLParser
, perhaps as an additional possible value for the already existingtrimValues
, to dedent (only keep relative indentation between lines, seededent
package and the String.dedent proposal) tag values.Using indentation for tag values is very common in xml files, pretty much every multiline tag value (as in more than one line in the value itself,
<tag>\n\tvalue\n</tag>
happens to work withtrimValues
already) makes use of this.My use case is parsing descriptions in wayland protocol xml files for https://wayland.app/. We are currently using
tagValueProcessor
totrim
every line individually, but I'm working on parsing of nested markdown-like lists, for example inlinux-dmabuf-unstable-v1.xml
:It's possible to workaround this with
tagValueProcessor
, but for how common and useful this is, and it being non-trivial to implement or requiring an additional dependency, I think it's worth having infast-xml-parser
(maybe as the default in a future breaking release? Although it does incur an additional performance cost). The implementation can also be switched toString.dedent
transparently in the future when it's added and gets enough browser + node support.Beta Was this translation helpful? Give feedback.
All reactions