This commit is contained in:
ZigHolding 2025-07-05 23:02:23 +08:00
parent af393a6ba4
commit 09cb452eb7

View file

@ -221,7 +221,10 @@ const cmd_export_wxmp = (plugin:NoteSyncPlugin) => ({
hotkeys: [{ modifiers: ['Alt', 'Shift'], key: 'P' }],
callback: async () => {
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 rhtml = await plugin.wxmp.html_to_wxmp(html);
plugin.wxmp.copy_as_html(rhtml);