fix(blog): لینک کپشن رندر عمومی را میکراند (اسپرد اسپک) + نوار ابزار با جابهجایی کرسر آپدیت شود + صفحهٔ ادیتور انگلیسی LTR
This commit is contained in:
@@ -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]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user