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:
@ -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
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user