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

Don't zoom when the image is wrapped in an <a> tag. #13

Open
walkxcode opened this issue Jan 9, 2023 · 1 comment
Open

Don't zoom when the image is wrapped in an <a> tag. #13

walkxcode opened this issue Jan 9, 2023 · 1 comment

Comments

@walkxcode
Copy link

Hello,

I'm currently having this really annoying "bug", when if you click on an image that is inside an tag it won't let you click the image, and will just zoom into it. Is there a way I can make the plugin ignore images wrapped inside an tag?

@scottamain
Copy link

scottamain commented Dec 19, 2024

I was having the same issue and realized that, yes, you can do this using the selector to enable zoom only for img tags that are not children of an a tag (see the usage docs):

      zoom: {
        selector: '.markdown :not(a) > img',
        background: {
          light: 'rgb(255, 255, 255)',
          dark: 'rgb(50, 50, 50)'
        },
      }

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

No branches or pull requests

2 participants