🐛 Fixed pasting html into a KoenigBasicHtmlInput

refs https://github.com/TryGhost/Team/issues/1245

- Several inputs where dismissing the content when pasting HTML without the expected input tag
- The inputs where: the caption of the feature image; the email footer; the caption in the bookmark, code, embed, gallery, image, video cards; the callout card title; the product card header and description; the toggle header
- This makes sure the wrapper html tag is the expected one.

Co-authored-by:
- Kevin Ansfield (@kevinansfield)
This commit is contained in:
Thibaut Patel 2021-12-08 14:22:33 +01:00
parent 773d43697c
commit b03f72c59e

View File

@ -363,6 +363,11 @@ export default Component.extend({
} }
// ----------------------------------------------------------------- // -----------------------------------------------------------------
// convert first section to the expected tag type (might be a heading, blockquote, etc)
if (pastedPost.sections.head) {
pastedPost.sections.head.tagName = this.defaultTag;
}
// same as default // same as default
editor.run((postEditor) => { editor.run((postEditor) => {
const newPosition = postEditor.insertPost(position, pastedPost); const newPosition = postEditor.insertPost(position, pastedPost);