Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add Classes & Other Selectors for elementHandledElsewhere() #74

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
2 participants

wpsmith commented Mar 8, 2013

There was redundant code within elementHandledElsewhere() so I refactored it to executeHandlers() and added class names as a handler to elementHandledElsewhere().

If we follow the No Selector ID rule in CSS (as well as the notion that IDs are to identify a single element), it makes much more sense to have a .bypass class option available to users.

Also added other selectors as a possibility (e.g., div[id^="bypass-"]). This will ignore the function side.

So the addictions can be used as such:

specialElementHandlers = {
    // element with class of "bypass" - jQuery style selector
    'div[id^="bypass-"]': true,
    '.bypass': function(element, renderer){
        console.log('.bypass');
        // true = "handled elsewhere, bypass text extraction"
        return true
    }
}

wpsmith added some commits Mar 8, 2013

"other" selectors to elementHandledElsewhere()
Add comments & "other" selectors to elementHandledElsewhere()
Owner

MrRio commented Mar 11, 2013

Thanks for the PR. I'll review this evening.

@MrRio MrRio closed this May 15, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment