mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
added ts fix for node types
This commit is contained in:
parent
ee6a6ecf3f
commit
2329abe7dd
@ -75,18 +75,16 @@ export const TiptapExtensions = [
|
|||||||
return [
|
return [
|
||||||
new InputRule({
|
new InputRule({
|
||||||
find: /^(?:---|—-|___\s|\*\*\*\s)$/,
|
find: /^(?:---|—-|___\s|\*\*\*\s)$/,
|
||||||
handler: ({ state, range }) => {
|
handler: ({ state, range, commands }) => {
|
||||||
const attributes = {};
|
commands.splitBlock();
|
||||||
|
|
||||||
|
const attributes = {};
|
||||||
const { tr } = state;
|
const { tr } = state;
|
||||||
const start = range.from;
|
const start = range.from;
|
||||||
const end = range.to;
|
const end = range.to;
|
||||||
const node = this.type.create(attributes) as unknown as ProseMirrorNode;
|
// @ts-ignore
|
||||||
tr.insert(start - 1, node).delete(
|
tr.replaceWith(start - 1, end, this.type.create(attributes));
|
||||||
tr.mapping.map(start),
|
}
|
||||||
tr.mapping.map(end),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user