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

wants to merge 2 commits into


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){
        // 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()

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