In this gist: image in summary tag.md · GitHub
When I click on the text “Click to expand preview”, the
<details> tag is expanded as expected. However if I instead click on the image in the
<summary>, it doesn’t work. GitHub automatically wraps all images in an
<a> tag which links to the
src of the image.
I tried following the advice here to disable this automatic linking by wrapping the image in a markdown link to
#, which is what you see in the gist, but it seems that tip doesn’t work.
I also tried a blank or missing
href in an HTML
<a> tag, and a
foreignObject inside an SVG.
In general, is it possible to stop GitHub from auto-linking images to themselves? Or is there any other way that I could make clicking on the image expand the
I want to have this kind of expandable image in my GitHub profile README. I thought it would be a neat trick, but it’ll backfire completely if it’s unusable.