mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Create Markdown TOC at current cursor position
If there is no TOC in the current document, it's created at current cursor position. Subsequent generation calls update TOC at existing position. Add additional tests with CodeMirror editor mock.
This commit is contained in:
@@ -267,8 +267,8 @@ class MarkdownNoteDetail extends React.Component {
|
||||
}
|
||||
|
||||
handleGenerateToc () {
|
||||
markdownToc.generate(this.refs.content.value,
|
||||
(modifiedValue) => this.refs.content.refs.code.setValue(modifiedValue))
|
||||
const editor = this.refs.content.refs.code.editor
|
||||
markdownToc.generateInEditor(editor)
|
||||
}
|
||||
|
||||
handleFocus (e) {
|
||||
|
||||
Reference in New Issue
Block a user