neocotic / europa

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

Hidden elements #1

Closed neocotic closed 11 years ago

neocotic commented 12 years ago

Although detached or generated elements cannot have their styles computed and therefor visibility determined, the style.display property should at least be checked.

Also, it's probably worth while checking the visibility property.

neocotic commented 11 years ago

I think I'll start off with the simplest approach to this;

properties = ele.style.match /(display|visibility)\s*:\s*[a-z]+/gi
visible    = yes
if properties?
  for property in properties
    visible = not /(none|hidden)\s*$/i.test property

This should, at least for now, detect obvious hidden elements.

neocotic commented 11 years ago

This works as expected and I'll be sure to unit test it as part of #3.

skopp commented 11 years ago

You, sir, are a BOSS.. A

BOSS

skopp commented 11 years ago

sqrt(4096)

SSdkIGxpa2UgdG8gY2hhdCB3aXRoIHlvdS4gQ291bGQgeW91IGRyb3AgbWUgYSBtYWls

aWFtQGdteC5pdA==