mirror of
https://github.com/zigholding/obsidian-notesync-plugin.git
synced 2026-07-22 05:43:30 +00:00
wxmp
This commit is contained in:
parent
af393a6ba4
commit
09cb452eb7
1 changed files with 4 additions and 1 deletions
|
|
@ -221,7 +221,10 @@ const cmd_export_wxmp = (plugin:NoteSyncPlugin) => ({
|
||||||
hotkeys: [{ modifiers: ['Alt', 'Shift'], key: 'P' }],
|
hotkeys: [{ modifiers: ['Alt', 'Shift'], key: 'P' }],
|
||||||
callback: async () => {
|
callback: async () => {
|
||||||
if(!plugin.easyapi.cfile){return}
|
if(!plugin.easyapi.cfile){return}
|
||||||
let ctx = await plugin.app.vault.read(plugin.easyapi.cfile);
|
let ctx = plugin.easyapi.ceditor.getSelection();
|
||||||
|
if(!ctx){
|
||||||
|
ctx = await plugin.app.vault.read(plugin.easyapi.cfile);
|
||||||
|
}
|
||||||
let html = plugin.wxmp.marked.marked(ctx);
|
let html = plugin.wxmp.marked.marked(ctx);
|
||||||
let rhtml = await plugin.wxmp.html_to_wxmp(html);
|
let rhtml = await plugin.wxmp.html_to_wxmp(html);
|
||||||
plugin.wxmp.copy_as_html(rhtml);
|
plugin.wxmp.copy_as_html(rhtml);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue