Skip to content
Snippets Groups Projects
Commit f0f070ba authored by chris's avatar chris
Browse files

alter notes schema

parent a2634a95
No related branches found
No related tags found
1 merge request!168Fix rerender notes
...@@ -8,7 +8,7 @@ const footnote = { ...@@ -8,7 +8,7 @@ const footnote = {
id: { default: '' }, id: { default: '' },
}, },
toDOM: node => { toDOM: node => {
return ['footnote', node.attrs, 0]; return ['footnote', node.attrs];
}, },
parseDOM: [ parseDOM: [
{ {
......
...@@ -13,8 +13,8 @@ class Note extends Tools { ...@@ -13,8 +13,8 @@ class Note extends Tools {
get run() { get run() {
return (state, dispatch) => { return (state, dispatch) => {
let { empty, $from, $to } = state.selection, const { empty, $from, $to } = state.selection;
content = Fragment.empty; let content = Fragment.empty;
if (!empty && $from.sameParent($to) && $from.parent.inlineContent) if (!empty && $from.sameParent($to) && $from.parent.inlineContent)
content = $from.parent.content.cut( content = $from.parent.content.cut(
$from.parentOffset, $from.parentOffset,
...@@ -22,7 +22,7 @@ class Note extends Tools { ...@@ -22,7 +22,7 @@ class Note extends Tools {
); );
const footnote = state.config.schema.nodes.footnote.create( const footnote = state.config.schema.nodes.footnote.create(
{ id: uuidv4() }, { id: uuidv4() },
Fragment.empty, content,
); );
dispatch(state.tr.replaceSelectionWith(footnote)); dispatch(state.tr.replaceSelectionWith(footnote));
}; };
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment