fix(blog): لینک کپشن رندر عمومی را می‌کراند (اسپرد اسپک) + نوار ابزار با جابه‌جایی کرسر آپدیت شود + صفحهٔ ادیتور انگلیسی LTR

This commit is contained in:
aramesh-site deploy
2026-10-07 07:20:43 +00:00
parent 27a9a82a37
commit bd310e8d18
3 changed files with 19 additions and 9 deletions
@@ -59,19 +59,17 @@ export const ArticleImage = Image.extend({
// کپشن خالی → عنصر figcaption اصلاً رندر نمی‌شود (فقط تصویر می‌ماند)
const captionHref = (HTMLAttributes.caption_href as string | undefined)?.trim() ?? ''
const figcaption: Array<string | Record<string, unknown>> = captionHref
? [
'a',
{ href: captionHref, target: '_blank', rel: 'noopener noreferrer nofollow' },
caption,
]
: [caption]
// توجه: آرایهٔ درونی به‌صورت تو در تو پاس می‌شود — اسپرد آن اسپک را تخت می‌کند
// و رندرر استاتیک با «Unsupported DomOutputSpec» می‌میرد.
const captionSpec = captionHref
? ['a', { href: captionHref, target: '_blank', rel: 'noopener noreferrer nofollow' }, caption]
: caption
return caption
? [
'figure',
{ class: 'article-figure' },
image,
['figcaption', { class: 'article-figure__caption' }, ...figcaption],
['figcaption', { class: 'article-figure__caption' }, captionSpec],
]
: ['figure', { class: 'article-figure' }, image]
},