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

Ignore user selected elements #51

Closed
anthonydillon opened this issue Oct 26, 2020 · 3 comments
Closed

Ignore user selected elements #51

anthonydillon opened this issue Oct 26, 2020 · 3 comments
Labels

Comments

@anthonydillon
Copy link

Could it be possible to pass a list of elements to the ignored?

For example:

options {
  'target': document.getElementById('main-content'),
  'exclude': document.querySelectorAll('.lazyload noscript'),
}
smartquotes(options);

This is issue arose as we use using this module which uses lazysizes to load the content from a noscript tag and inject it into the page to lazyload them. Here is the template logic:
https://github.com/canonical-web-and-design/canonicalwebteam.image-template/blob/master/canonicalwebteam/templates/image_template.html

An example of the failed output:
https://codepen.io/anthonydillon/pen/PozpjRd

@kellym
Copy link
Owner

kellym commented Oct 27, 2020

Hmm, this looks like your issue is caused from a bug in the script. I think the feature you're requesting wouldn't be necessary if it was handling noscript tags correctly. I'll take a look.

@kellym kellym added the bug label Oct 27, 2020
@anthonydillon
Copy link
Author

Yes of course, if noscript was added the exclude elements list that would resolve this. I wasn't sure if you could blacklist all content within noscript. But, I guess it doesn't matter if there is content within the noscript element as the script couldn't affect that anyway.

@kellym
Copy link
Owner

kellym commented Dec 3, 2020

This was resolved with #44. If that's incorrect, chime in here and we'll reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants