Merge pull request #978 from nagisa77/codex/fix-image-preview-trigger-in-markdown

fix: restrict image preview to markdown images
This commit is contained in:
Tim
2025-09-12 10:50:45 +08:00
committed by GitHub
3 changed files with 7 additions and 3 deletions

View File

@@ -342,7 +342,7 @@ const copyCommentLink = () => {
const handleContentClick = (e) => {
handleMarkdownClick(e)
if (e.target.tagName === 'IMG') {
if (e.target.tagName === 'IMG' && !e.target.classList.contains('emoji')) {
const container = e.target.parentNode
const imgs = [...container.querySelectorAll('img')].map((i) => i.src)
lightboxImgs.value = imgs

View File

@@ -463,7 +463,11 @@ function minimize() {
function handleContentClick(e) {
handleMarkdownClick(e)
if (e.target.tagName === 'IMG') {
if (
e.target.tagName === 'IMG' &&
!e.target.classList.contains('emoji') &&
!e.target.closest('.reactions-container')
) {
const container = e.target.parentNode
const imgs = [...container.querySelectorAll('img')].map((i) => i.src)
lightboxImgs.value = imgs

View File

@@ -434,7 +434,7 @@ const removeCommentFromList = (id, list) => {
const handleContentClick = (e) => {
handleMarkdownClick(e)
if (e.target.tagName === 'IMG') {
if (e.target.tagName === 'IMG' && !e.target.classList.contains('emoji')) {
const container = e.target.parentNode
const imgs = [...container.querySelectorAll('img')].map((i) => i.src)
lightboxImgs.value = imgs