We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a0802a commit 63876c6Copy full SHA for 63876c6
src/plugins/zoom-image.js
@@ -1,14 +1,20 @@
1
import mediumZoom from 'medium-zoom'
2
3
+const matchesSelector = Element.prototype.matches || Element.prototype.webkitMatchesSelector || Element.prototype.msMatchesSelector
4
+
5
function install(hook) {
6
let zoom
7
8
hook.doneEach(_ => {
9
+ let elms = Array.apply(null, document.querySelectorAll('.markdown-section img:not(.emoji):not([data-no-zoom])'))
10
11
+ elms = elms.filter(elm => matchesSelector.call(elm, 'a img') === false)
12
13
if (zoom) {
14
zoom.detach()
15
}
16
- zoom = mediumZoom('img:not(.emoji):not([data-no-zoom])')
17
+ zoom = mediumZoom(elms)
18
})
19
20
0 commit comments