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

Nokogiri::XML::NodeSet#to_xhtml adds invalid CDATA tags #311

Closed
JonCrawford opened this issue Jul 21, 2010 · 6 comments
Closed

Nokogiri::XML::NodeSet#to_xhtml adds invalid CDATA tags #311

JonCrawford opened this issue Jul 21, 2010 · 6 comments

Comments

@JonCrawford
Copy link

Run the following gist: https://gist.github.com/f1ec33937642648a78cb

Notice the <![CDATA[ ]]> tag that is created inside the <style> tag. This is bad because CDATA tags inside <style> tags require CSS comments around them or they have they cause the CSS to not be parsed by the browser.

Info here about CDATA tags: http://en.wikipedia.org/wiki/CDATA#Use_of_CDATA_in_program_output

Fixies?

@tenderlove
Copy link
Member

I need to rewrite this example in C and supply it to the libxml2 team. I suspect this is a bug in libxml2.

@JonCrawford
Copy link
Author

Bump.

@matthewwithanm
Copy link

Ran the gist with libxml2 2.6.16 and didn't get any CDATA tags so, yeah, looks like a libxml bug.

@kpitn
Copy link

kpitn commented Jan 27, 2011

Same problem with master and ubuntu 10.10

@flavorjones
Copy link
Member

Confirmed bug still present upstream in libxml 2.9.4.

@flavorjones
Copy link
Member

I believe this behavior was introduced in libxml 2.6.31 in GNOME/libxml2@dbd6105 and appears to be intentional. Closing.

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

5 participants