Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cdata #8

Open
FrankIT60 opened this issue Nov 14, 2022 · 3 comments
Open

cdata #8

FrankIT60 opened this issue Nov 14, 2022 · 3 comments

Comments

@FrankIT60
Copy link

Ciao,

I try to format this string but receive a panic.

"<book><author>Fred</author><text><![CDATA[<message> Welcome to xmlfmt </message>]]></text><isbn>23456</isbn></book>"

@AntonioSun
Copy link
Contributor

Yeah, that day has come -- I was hoping that people would not be dealing with CDATA, but the day has finally come.

I meant, the xml CDATA is very convoluted to me, and I had no idea how to deal it, even up till today.

If the RE matching is not complicated enough for you, would you care to send in a PR pls?

@AntonioSun
Copy link
Contributor

AntonioSun commented Nov 14, 2022

One idea is to change the CDATA to comment before feeding to RE matching, then change it back afterwards. However, I do not know xml CDATA syntax well enough to know if it'll theoretically work.

You can try that kind of data massages on your side before calling xmlfmt if you want, before a proper fix can be done to this lib.

@FrankIT60
Copy link
Author

FrankIT60 commented Nov 15, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants