rename
This commit is contained in:
@@ -16,7 +16,7 @@ function defaultBlockAt(match: ContentMatch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface SplitBlockOptions {
|
export interface SplitBlockOptions {
|
||||||
withMarks: boolean,
|
keepMarks: boolean,
|
||||||
}
|
}
|
||||||
|
|
||||||
function keepMarks(state: EditorState) {
|
function keepMarks(state: EditorState) {
|
||||||
@@ -38,7 +38,7 @@ export const splitBlock = (options: Partial<SplitBlockOptions> = {}): Command =>
|
|||||||
editor,
|
editor,
|
||||||
}) => {
|
}) => {
|
||||||
const defaultOptions: SplitBlockOptions = {
|
const defaultOptions: SplitBlockOptions = {
|
||||||
withMarks: true,
|
keepMarks: true,
|
||||||
}
|
}
|
||||||
const config = { ...defaultOptions, ...options }
|
const config = { ...defaultOptions, ...options }
|
||||||
const { selection, doc } = tr
|
const { selection, doc } = tr
|
||||||
@@ -56,7 +56,7 @@ export const splitBlock = (options: Partial<SplitBlockOptions> = {}): Command =>
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (dispatch) {
|
if (dispatch) {
|
||||||
if (config.withMarks) {
|
if (config.keepMarks) {
|
||||||
keepMarks(state)
|
keepMarks(state)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ export const splitBlock = (options: Partial<SplitBlockOptions> = {}): Command =>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.withMarks) {
|
if (config.keepMarks) {
|
||||||
keepMarks(state)
|
keepMarks(state)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user