Skip to content

Commit f856d39

Browse files
committed
feat: ✨ add slash command "markdown-table-editor"
1 parent 7d63da4 commit f856d39

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if (isInBrower) {
3131
}
3232
`)
3333
console.log('[faiz:] === markdown-table-editor-plugin loaded')
34-
logseqEditor.registerBlockContextMenuItem('markdown-table-editor', (e) => {
34+
const commandCallback = (e) => {
3535
console.log('[faiz:] === woz-markdown-table-editor', e)
3636
logseqEditor.getBlock(e.uuid).then(block => {
3737
console.log('[faiz:] === block', block)
@@ -62,7 +62,9 @@ if (isInBrower) {
6262
// window.logseq.App.showMsg('Sorry, block content format to markdown table error', 'warning')
6363
// console.log('[faiz:] === block content format to markdown table error')
6464
})
65-
})
65+
}
66+
logseqEditor.registerBlockContextMenuItem('markdown-table-editor', commandCallback)
67+
logseqEditor.registerSlashCommand('markdown-table-editor', commandCallback)
6668

6769
logseq.on('ui:visible:changed', (e) => {
6870
if (!e.visible) {

0 commit comments

Comments
 (0)