1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-15 12:41:52 +03:00

Added horizonal rule insert

This commit is contained in:
Dan Brown
2022-01-14 14:33:37 +00:00
parent 013943dcc5
commit 0dc64d22ef
6 changed files with 45 additions and 13 deletions

View File

@ -33,6 +33,18 @@ export function setBlockAttr(attrName, attrValue) {
dispatch(tr);
}
return true
}
}
export function insertBlockBefore(blockType) {
return function (state, dispatch) {
const startPosition = state.selection.$from.before(1);
if (dispatch) {
dispatch(state.tr.insert(startPosition, blockType.create()));
}
return true
}
}