You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you for making a good plugin. It is very helpful for publishing my obsidian document on the website with the WYSIWYG editor.
But I had to edit the plugin script to use in various environments, it would be great if some functions were supported by default.
Keeping local images src as it is
-> When many images are included in an obsidian document, encoding and pasting the whole converted HTML takes some time.
Rather than encoding images to base64, I think keeping the original app://image-path in the src is useful in some cases. (After pasting the HTML source, users can replace the image with the proper one.
like...
asyncreplaceImageSource(image){constimageSourcePath=decodeURI(image.src);if(this.options.leaveLocalImages){// if the option 'leaveLocalImages' is toggled on, do not replace the image source..}else{if(imageSourcePath.startsWith(this.vaultUriPrefix)){letpath=imageSourcePath.substring(this.vaultUriPrefix.length+1).replace(/[?#].*/,"");path=decodeURI(path);constmimeType=this.guessMimeType(path);constdata=awaitthis.readFromVault(path,mimeType);if(this.isSvg(mimeType)&&this.options.convertSvgToBitmap){image.src=awaitthis.imageToDataUri(data);}else{image.src=data;}}else{image.src=awaitthis.imageToDataUri(image.src);}}}
Adding custom class to container div
-> It would be useful when using a custom stylesheet. If I want to post my obsidian document on a website (but not an independent document), the stylesheet should not make changes to the original website appearance. I think adding a class to the container div would resolve this problem!
Like..
asyncrenderMarkdown(markdown,path){constprocessedMarkdown=this.preprocessMarkdown(markdown);constwrapper=document.createElement("div");if(this.options.customClassDiv){// adding custom class to wrapper divwrapper.className=this.options.customClassDiv;}wrapper.style.display="hidden";document.body.appendChild(wrapper);awaitimport_obsidian.MarkdownRenderer.render(this.app,processedMarkdown,wrapper,path,this.view);awaitthis.untilRendered();constresult=wrapper.cloneNode(true);document.body.removeChild(wrapper);this.view.unload();returnresult;}
Thanks again for making this plugin!
The text was updated successfully, but these errors were encountered:
It seems that your use-case is publishing HTML documents from Obsidian, which is not entirely what I had in mind when I wrote this plugin. In fact, its main purpose was to convert all types of image representations (images, diagrams etc...) to data:base64 for inclusion in gmail or word documents.
First of all, thank you for making a good plugin. It is very helpful for publishing my obsidian document on the website with the WYSIWYG editor.
But I had to edit the plugin script to use in various environments, it would be great if some functions were supported by default.
-> When many images are included in an obsidian document, encoding and pasting the whole converted HTML takes some time.
Rather than encoding images to base64, I think keeping the original
app://image-path
in the src is useful in some cases. (After pasting the HTML source, users can replace the image with the proper one.like...
-> It would be useful when using a custom stylesheet. If I want to post my obsidian document on a website (but not an independent document), the stylesheet should not make changes to the original website appearance. I think adding a class to the container div would resolve this problem!
Like..
Thanks again for making this plugin!
The text was updated successfully, but these errors were encountered: