Skip to content

Commit

Permalink
πŸ› (#107): calcule headers on creation
Browse files Browse the repository at this point in the history
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
  • Loading branch information
Vinicius Reis committed Aug 16, 2022
1 parent 7651779 commit 8ade6ca
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/nodes/Heading/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ const Heading = TipTapHeading.extend({
}
},

onCreate() {
extractHeadings(this.editor)

if (this.parent) {
this.parent()
}
},

onUpdate: debounce(function onUpdate({ editor }) {
extractHeadings(editor)
}, 900),
Expand Down

0 comments on commit 8ade6ca

Please sign in to comment.