mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-24 19:59:02 +08:00
rename
This commit is contained in:
parent
97eb9c411c
commit
c2cb0e8752
@ -16,7 +16,7 @@ function defaultBlockAt(match: ContentMatch) {
|
||||
}
|
||||
|
||||
export interface SplitBlockOptions {
|
||||
withMarks: boolean,
|
||||
keepMarks: boolean,
|
||||
}
|
||||
|
||||
function keepMarks(state: EditorState) {
|
||||
@ -38,7 +38,7 @@ export const splitBlock = (options: Partial<SplitBlockOptions> = {}): Command =>
|
||||
editor,
|
||||
}) => {
|
||||
const defaultOptions: SplitBlockOptions = {
|
||||
withMarks: true,
|
||||
keepMarks: true,
|
||||
}
|
||||
const config = { ...defaultOptions, ...options }
|
||||
const { selection, doc } = tr
|
||||
@ -56,7 +56,7 @@ export const splitBlock = (options: Partial<SplitBlockOptions> = {}): Command =>
|
||||
}
|
||||
|
||||
if (dispatch) {
|
||||
if (config.withMarks) {
|
||||
if (config.keepMarks) {
|
||||
keepMarks(state)
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ export const splitBlock = (options: Partial<SplitBlockOptions> = {}): Command =>
|
||||
}
|
||||
}
|
||||
|
||||
if (config.withMarks) {
|
||||
if (config.keepMarks) {
|
||||
keepMarks(state)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user