diff options
author | Vinicius Reis <vinicius.reis@nextcloud.com> | 2022-08-16 22:11:43 +0300 |
---|---|---|
committer | Vinicius Reis <vinicius.reis@nextcloud.com> | 2022-08-17 17:42:59 +0300 |
commit | 713720d14db3a0ad0405bdf4b047018a7d6cf6c8 (patch) | |
tree | 0d99813724d02214904b9cef9fdd156314c69508 /src/nodes | |
parent | 381797c4c6730c918e0c0fa57e3e838059d828d2 (diff) |
🐛 (#107): calcule headers on creation
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
Diffstat (limited to 'src/nodes')
-rw-r--r-- | src/nodes/Heading/index.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nodes/Heading/index.js b/src/nodes/Heading/index.js index 258b094fb..ce7e73e78 100644 --- a/src/nodes/Heading/index.js +++ b/src/nodes/Heading/index.js @@ -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), |