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

Invalid XML output if string contains "&". #7

Open
fuuka opened this issue Oct 18, 2011 · 1 comment
Open

Invalid XML output if string contains "&". #7

fuuka opened this issue Oct 18, 2011 · 1 comment
Assignees

Comments

@fuuka
Copy link

fuuka commented Oct 18, 2011

If string contains "&", it not escape to "&". So output XML is invalid.

ruby-1.9.2-p290 :001 > "a&b".to_plist_xml
 => "<string>a&b</string>" 

from "bundle list":

* nokogiri (1.5.0)
* nokogiri-plist (0.5.0)
@ghost ghost assigned caseyhoward Oct 18, 2011
@caseyhoward
Copy link
Owner

I was looking into your bug, when I realized that I'm an idiot for not using Nokogiri to build the XML. Nokogiri handles special characters and other cases. I was just using Nokogiri to parse. Anyway, I'm working on a new branch with this change. It makes the code a lot more simple. It's working for all I know. I just need to test it more and update the documentation. Here's the branch: https://github.com/caseyhoward/nokogiri-plist/tree/nokogiri_xml_builder if you want to check it out. I could have made a quick fix using CGI::escape, but I think this is a lot better.

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

No branches or pull requests

2 participants