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 7b67d3a commit 9f534aaCopy full SHA for 9f534aa
templates/modern/src/markdown.ts
@@ -114,9 +114,18 @@ async function renderClickableImage() {
114
const a = document.createElement('a')
115
a.target = '_blank'
116
a.rel = 'noopener noreferrer nofollow'
117
- a.href = img.src
118
- img.replaceWith(a)
119
- a.appendChild(img)
+
+ if (img.parentElement.tagName === 'PICTURE') {
+ const picture = img.parentElement
120
+ picture.addEventListener('click', () => {
121
+ a.href = img.currentSrc
122
+ a.click()
123
+ })
124
+ } else {
125
+ a.href = img.src
126
+ img.replaceWith(a)
127
+ a.appendChild(img)
128
+ }
129
}
130
131
function shouldMakeClickable(): boolean {
0 commit comments