meld-cp / obsidian-encrypt

Hide secrets in your Obsidian.md vault
MIT License
544 stars 32 forks source link

setting to use .md or .mdenc for live preview formatting of encrypted notes #127

Closed LiamSwayne closed 8 months ago

LiamSwayne commented 9 months ago

In 2.3.2, encrypted notes started using .mdenc instead of .md. Notes are presented as txts, and live preview formatting doesn't work. Only reading view shows formatting.

A setting to use .md or .mdenc could be used to enable or disable live preview formatting in encrypted notes.

Edit: Another reason to enable the option for .md is Obsidian Sync. Because .mdenc isn't recognized as a normal note, you have to enable syncing for all unsupported file types just to sync an encrypted note.

Whoareyouagain commented 9 months ago

I second this. It is nice to have a encrypted note but I couldn't use it due to plugins are not detecting the mdenc file as .md thus preventing plugins not to functions within .mdenc.

I have community plugin installed, Advanced Tables. I used this plugin to give me CSV-like view for my tables in source view. There is one table that I want to keep it encrypted and I have over 400 cells in that file. Decrypted note prevents the source view from autoformatting to function which made it a pain to add vertical bar "|" or append a column to 100+ rows automatically. It also prevented Editing Toolbar, another community plugin, to function inside the decrypted source note as well.

I could use in-place option, however the issue is my vault lives in OneDrive folder. Once I decrypt the in-place, the text become plain-text and saved automatically in OneDrive. And OneDrive have file versioning for every revision which defeat the purpose of using Meld Encrypt plugin.

I would like an option to allow the plugins to function in decrypted source view if this is possible.

azigler commented 8 months ago

Came here to express the same viewpoint as @Whoareyouagain, as the new file format breaks the preview and interferes with how other plugins can be utilized with an encrypted note. @LiamSwayne makes a good point that it also disables file syncing by default.

A setting to toggle between md and mdenc (or set a custom extension entirely) would allow greater flexibility.

meld-cp commented 8 months ago

Greetings,

Just to clarify the comments by @LiamSwayne & @azigler, 2.3.2 didn't change the extension of encrypted notes from .md to .mdenc, it changed it from .encrypted to .mdenc. Unfortunately, Live Preview has never worked. 😔 but why?

As long as the plugin has to use it's own editor to keep it's contents encrypted on disk, it will never have the same rich editing features of .md notes.

This is also the reason why other plugins aren't compatible.

To make this pain easier, 2.3.0 added a feature to quickly decrypt an encrypted note back to .md. This brings back the rich editing and plugin experience, but with the downside of the note now sitting on disk in plaintext until it's re-encrypted... and, as @Whoareyouagain mentioned, being plaintext for a moment means that it is also open for any backup or file-sync to store it elsewhere.

Unfortunately, I don't have a way around this limitation.

LiamSwayne commented 8 months ago

Thanks for the clarification