cryptee / web-client

Cryptee's web client source code for all platforms.
https://crypt.ee
Other
444 stars 22 forks source link

[Question] Which Markdown flavor does Cryptee use? #163

Closed shawn1thompson closed 1 year ago

shawn1thompson commented 1 year ago

Just a question and wasn't sure how else to ask. What Markdown flavor is used?

johnozbay commented 1 year ago

Hi there! 👋🏻

Thanks for filing this!

This question comes up surprisingly quite often, and I think we should do a better job at clarifying things. With your permission, I'll refer to this thread in the future when it comes up.


First off, Cryptee is not a markdown editor. It is a rich document editor, similar to Google Docs / Word, with its own document format, that is not based on markdown.

In short, Cryptee stores docs and works with its own rich-text format, and there's only shortcuts to type rich text quicker using Markdown. So we support markdown shortcuts, but it's limited to what's in the original markdown specifications. So no flavors, just pure raw markdown shortcuts for easier text-style input.

Which if you think about it, Markdown is used commonly in messaging apps / comments etc with small text input boxes (where there's not enough room to put styling buttons) for this exact purpose, easy / faster input.


However Markdown itself, is actually a terrible format to store raw rich text document data.

So making a rich document editor entirely markdown-based is generally a bad idea, and a very limiting approach to rich-text editing. Cryptee has many features that the original Markdown spec doesn't support. Like linking documents, tagging, tables, coloring/custom font-sizing etc. Surprisingly none of these, not even tables, are a part of the original markdown specifications. You can see the latest version here.

All of these features would require adding custom-markdown tags just for Cryptee (or using a custom flavor), resulting in moving away from Markdown's standards very quickly, making development really difficult in the longer run. (and make Cryptee pretty much interoperable with all other markdown editors right away)

Some apps support tables / or editing links etc using markdown flavors, but they're actually not a part of the markdown spec, and every company has a different interpretation of it. ( for example GitHub uses its own extended flavor, based on CommonMark : https://github.github.com/gfm/ )

And in the interest of maintenance, long-term interoperability, — which is incredibly important for a service like Cryptee, dealing with lots of imports / exports from other applications — we can't store things in raw-markdown. And as a side effect, you can't edit links like you could with markdown for example. But you can input things using the same old familiar markdown shortcuts. We think that this provides the best of both worlds with very little compromise.

Finally, since your documents are encrypted on your device, and our servers can't access your documents, our servers also cannot do maintenance on your documents in the future either. So if some day in the future these flavors casually change, things like tables (which are not a part of the original markdown spec) would break, or it could cause crazy inter-operability issues between softwares that support markdown, and our servers wouldn't be able to update your documents due to encryption.


Hoping these make sense, clarify a few things and help! ✌🏻

Best,

J