eval / rack-pjax

pjax for rails and rack applications
http://rack-pjax.herokuapp.com/
MIT License
205 stars 65 forks source link

#inner_html is choking on self-closing tags within HTML5 elements #5

Closed matthooks closed 13 years ago

matthooks commented 13 years ago

See https://github.com/hpricot/hpricot/issues/48

Re: https://github.com/eval/rack-pjax/blob/master/lib/rack/pjax.rb#L24

It appears Hpricot has some issues with HTML5 tags. This can be avoided by using to_original_html instead of inner_html.

Unfortunately, unlike inner_html, to_original_html returns the container element as well as the html inside of it so we can't use it directly and instead must iterate over the children.

I've attached a pull request (with passing spec) for your perusal.

eval commented 13 years ago

Thanks for the patch!