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

void selector is whitespace-sensitive #94

Open
gtebbutt opened this issue Feb 4, 2014 · 2 comments
Open

void selector is whitespace-sensitive #94

gtebbutt opened this issue Feb 4, 2014 · 2 comments
Assignees

Comments

@gtebbutt
Copy link

gtebbutt commented Feb 4, 2014

Possibly expected behaviour, but it seemed worth mentioning: the void selector currently excludes nodes which contain only whitespace (where a CSS :empty selector would match).

[[:div#menu void]]

matches:

<div id="menu"></div>

but not:

    <div id="menu">
    </div>

The fix is very simple:

(def void (pred #(empty? (remove empty? (map clojure.string/trim (:content %))))))
@fdserr fdserr modified the milestone: 2.x.x Jul 10, 2015
@fdserr
Copy link
Collaborator

fdserr commented Jul 10, 2015

Good point! SGML states that these two snippets are equivalent. Nevertheless your fix may break existing programs that coped with this "feature", so we'll consider it for a major version.
Thankies!

@cgrand
Copy link
Owner

cgrand commented Sep 2, 2015

What about adding a dedicated whitespace ou whitespace-only selector? (and cross document the new selector and void)

@fdserr fdserr self-assigned this Sep 2, 2015
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

3 participants