Skip to content
Snippets Groups Projects
Commit 70a19e4f authored by chris's avatar chris
Browse files

only remove decoration if image

parent 33f1bf9c
No related branches found
No related tags found
No related merge requests found
Pipeline #58146 passed with stages
in 6 minutes and 4 seconds
......@@ -6,7 +6,7 @@ import {
RemoveMarkStep,
Mapping,
} from 'prosemirror-transform';
import { isEmpty } from 'lodash';
import DocumentHelpers from '../document/DocumentHelpers';
import replaceStep from './helpers/replaceStep';
import replaceAroundStep from './helpers/replaceAroundStep';
......@@ -181,9 +181,14 @@ const trackedTransaction = (
if (tr.scrolledIntoView) newTr.scrollIntoView();
console.log(tr.meta);
const imagePlaceholder = context.app.PmPlugins.get('imagePlaceHolder');
return newTr.setMeta(imagePlaceholder, { remove: { id: {} } });
if (
!isEmpty(tr.meta) &&
Object.keys(tr.meta).every(meta => meta.includes('imagePlaceHolder'))
) {
const imagePlaceholder = context.app.PmPlugins.get('imagePlaceHolder');
return newTr.setMeta(imagePlaceholder, { remove: { id: {} } });
}
return newTr;
};
export default trackedTransaction;
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment