🐛 Koenig - Fixed missing alt/title attributes when pasting markdown or HTML

refs https://github.com/TryGhost/Ghost/issues/9724
- capture the `alt` and `title` attributes in our figure and image parser plugins
This commit is contained in:
Kevin Ansfield 2018-08-13 09:50:56 +01:00
parent e7bcd220a0
commit 46129aca55
1 changed files with 10 additions and 2 deletions

View File

@ -33,7 +33,11 @@ export function figureToImageCard(node, builder, {addSection, nodeFinished}) {
return;
}
let payload = {src: img.src};
let payload = {
src: img.src,
alt: img.alt,
title: img.title
};
if (figcaption) {
// TODO: Allow rich text in captions
@ -50,7 +54,11 @@ export function imgToCard(node, builder, {addSection, nodeFinished}) {
return;
}
let payload = {src: node.src};
let payload = {
src: node.src,
alt: node.alt,
title: node.title
};
let cardSection = builder.createCardSection('image', payload);
addSection(cardSection);