1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-24 07:42:07 +03:00

Added jsdoc types for prosemirror

Also added link markdown handling when target is set.
This commit is contained in:
Dan Brown
2022-01-16 15:21:57 +00:00
parent 89194a3f85
commit 7622106665
9 changed files with 198 additions and 17 deletions

View File

@ -1,3 +1,8 @@
/**
* @param {String} attrName
* @param {String} attrValue
* @return {PmCommandHandler}
*/
export function setBlockAttr(attrName, attrValue) {
return function (state, dispatch) {
const ref = state.selection;
@ -37,6 +42,10 @@ export function setBlockAttr(attrName, attrValue) {
}
}
/**
* @param {PmNodeType} blockType
* @return {PmCommandHandler}
*/
export function insertBlockBefore(blockType) {
return function (state, dispatch) {
const startPosition = state.selection.$from.before(1);
@ -49,6 +58,9 @@ export function insertBlockBefore(blockType) {
}
}
/**
* @return {PmCommandHandler}
*/
export function removeMarks() {
return function (state, dispatch) {
if (dispatch) {