jbt / markdown-editor

Live (Github-flavored) Markdown Editor
http://jbt.github.com/markdown-editor
ISC License
2.82k stars 643 forks source link

File contents in URL may need to be re-thought... #52

Closed BourgeoisBear closed 6 years ago

BourgeoisBear commented 8 years ago

Limit is around 2000 chars: http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers

Perhaps some kind of pastebin action would be more suitable.

jbt commented 8 years ago

I'm open to suggestions here - from my experimentation I found that the 2000 char limit doesn't tend to apply to the hash part of the url but do correct me if I'm wrong there. For example it's perfectly happy with the complete text of Hamlet and that's definitely longer than 2000 characters.

The concern around the size of the url is also the reason for DEFLATE-ing everything before putting it in the url.

I do have some thoughts and a prototype around creating a version with a real storage backend - the only problem is what to use as that backend - I'm not too keen on (for example) opening up one of my own S3 buckets for people to store whatever they like. Again, open to suggestions what to do here.

BourgeoisBear commented 8 years ago

Seeing all of the base64 (assuming) chars pop up in my URL as I typed was a sort-of WTF moment when I first used it, but then I read your note and was cool with it.

Then I was writing a moderately long post (probably around 5 8.5" x 11" pages worth), and I noticed the editor becoming progressively less responsive as the character count grew. The type-deflate-base64-url loop may be contributing to that (fairly certain all of the translate/format/color stuff still has the greater impact).

Making this an on-demand feature with a key-combo instead of an automatic one would be my preference.

When I remembered the URL "limit", pastebin was the first thing that came to my mind. The guy who had the most thorough answer in that stack overflow post is Paul Dixon, author of pastebin. From his post, he has already struggled with this, and pastebin was his solution -- not to say it is the best one.

If you were ambitious, this would be a starting place for some kind of tightly-integrated free/premium cloud service.

Great job overall though. Was using MarkdownPad, which is fast on input, but very slow to start. Your markdown-editor is fantastic as long as I keep my posts short.

jiangminbai commented 8 years ago

@jbt niu

aero31aero commented 6 years ago

@BourgeoisBear this feature has been made available via a button on http://rohitt.me/markdown-editor for now. I'm open to further discussion if you're interested.

Closing this. Please read #77.