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

JRuby-Nokogiri generates non-wellformed XHTML #1084

Closed
denisdefreyne opened this issue Apr 20, 2014 · 4 comments
Closed

JRuby-Nokogiri generates non-wellformed XHTML #1084

denisdefreyne opened this issue Apr 20, 2014 · 4 comments

Comments

@denisdefreyne
Copy link

Steps to reproduce

raw_content = <<-XML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Test</title>
    <script type="text/javascript" src="/test.js"></script>
  </head>
  <body>
  </body>
</html>
XML

require 'nokogiri'

doc = Nokogiri::XML.parse(raw_content, nil, 'UTF-8')
puts doc.to_xhtml

Expected output

[snip]
    <script src="/test.js" type="text/javascript">
</script>
[snip]

Actual output

[snip]
    <script src="/test.js" type="text/javascript" />
</script>
[snip]

Note how the first script tag is self-closed.

@headius
Copy link
Contributor

headius commented Apr 21, 2014

I can't reproduce this on master using your script.

@denisdefreyne
Copy link
Author

I can’t test on master since I don’t know how to install Nokogiri from master, unfortunately…

@headius
Copy link
Contributor

headius commented Apr 23, 2014

It should be as simple as "rake compile" after getting appropriate deps, but if you have trouble I could try to build a gem to test.

@denisdefreyne
Copy link
Author

Yup, this one is fixed in master!

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