mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
🐛 Koenig - Fixed pasting of rich-text image captions losing formatting
refs https://github.com/TryGhost/Ghost/issues/9724 - caption payload changed from `textContent` to a cleaned `innerHTML` in our `figureToImageCard` parser plugin
This commit is contained in:
parent
e082d40d56
commit
22d07c9692
1 changed files with 4 additions and 2 deletions
|
@ -1,3 +1,5 @@
|
|||
import {cleanBasicHtml} from 'koenig-editor/helpers/clean-basic-html';
|
||||
|
||||
// mobiledoc by default ignores <BR> tags but we have a custom SoftReturn atom
|
||||
export function brToSoftBreakAtom(node, builder, {addMarkerable, nodeFinished}) {
|
||||
if (node.nodeType !== 1 || node.tagName !== 'BR') {
|
||||
|
@ -40,8 +42,8 @@ export function figureToImageCard(node, builder, {addSection, nodeFinished}) {
|
|||
};
|
||||
|
||||
if (figcaption) {
|
||||
// TODO: Allow rich text in captions
|
||||
payload.caption = figcaption.textContent;
|
||||
let cleanHtml = cleanBasicHtml(figcaption.innerHTML);
|
||||
payload.caption = cleanHtml;
|
||||
}
|
||||
|
||||
let cardSection = builder.createCardSection('image', payload);
|
||||
|
|
Loading…
Add table
Reference in a new issue