neocotic / europa

Library for converting HTML into valid Markdown
MIT License
159 stars 24 forks source link

(#35) Fix errors in IE 8 and older #36

Closed lukerattei closed 11 years ago

lukerattei commented 11 years ago

This pull request addresses issue #35.

Without this patch, IE 8 raises the error "Object doesn't support this property or method" and fails to parse. One error was caused by match() being called on a CSSStyleDeclaration object instead of a String. Another error was caused by window.Node being undefined in IE 8 and older. This patch checks for match() to be a function before calling it. This patch also defines window.Node if it needs to be defined.

neocotic commented 11 years ago

I did have a workaround pre-3.0 that handled the latter case but I don't know why I removed it to be honest. I'm going to have a think and try to remember why I removed this though it was probably an oversight.

Thanks for your contributions and sorry for taking so long to get back to you.

neocotic commented 11 years ago

Apologies, closed by accident. I remember why I removed the existing polyfiller for window.Node; I mistaking thought I only did it for compatibility with jsdom and forgot about legacy IE support. The other fix looks good too.

Once you've made the previously recommended changes I'll be happy to merge this in.

lukerattei commented 11 years ago

No problem. Thanks for reviewing this!