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

fix enter in caption

parent 62f4a077
No related branches found
No related tags found
No related merge requests found
Pipeline #55873 passed with stages
in 4 minutes and 19 seconds
......@@ -59,6 +59,10 @@ const backSpaceShortCut = (state, dispatch, view) => {
};
const pressEnter = (state, dispatch) => {
// Images
if (state.selection.$head.parent.type.name === 'figcaption') {
return true;
}
if (state.selection.node && state.selection.node.type.name === 'image') {
const { $from, to } = state.selection;
......@@ -68,6 +72,7 @@ const pressEnter = (state, dispatch) => {
dispatch(state.tr.setSelection(NodeSelection.create(state.doc, pos)));
return true;
}
// LISTS
if (splitListItem(state.schema.nodes.list_item)(state)) {
splitListItem(state.schema.nodes.list_item)(state, dispatch);
......
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