Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

Commit 46129ac

Browse files
committed
🐛 Koenig - Fixed missing alt/title attributes when pasting markdown or HTML
refs TryGhost/Ghost#9724 - capture the `alt` and `title` attributes in our figure and image parser plugins
1 parent e7bcd22 commit 46129ac

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/koenig-editor/addon/options/parser-plugins.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ export function figureToImageCard(node, builder, {addSection, nodeFinished}) {
3333
return;
3434
}
3535

36-
let payload = {src: img.src};
36+
let payload = {
37+
src: img.src,
38+
alt: img.alt,
39+
title: img.title
40+
};
3741

3842
if (figcaption) {
3943
// TODO: Allow rich text in captions
@@ -50,7 +54,11 @@ export function imgToCard(node, builder, {addSection, nodeFinished}) {
5054
return;
5155
}
5256

53-
let payload = {src: node.src};
57+
let payload = {
58+
src: node.src,
59+
alt: node.alt,
60+
title: node.title
61+
};
5462

5563
let cardSection = builder.createCardSection('image', payload);
5664
addSection(cardSection);

0 commit comments

Comments
 (0)