Hacker News new | ask | show | jobs
by honie 1783 days ago
No pressure at all! I could just... not think about it if I didn't want to. :p

I took another stab at it and this is what I ended up with: https://gist.github.com/honmanyau/5680d1c7b823d454122a0275ba...

It's now a Gist because I only realised later that the original note will be deleted after 24 hours.

There are now two mechanisms that persist data between sessions:

1. Auto-saving to localStorage every 5000 ms (adjustable as per the instructions). 2. Manual data saving/download implemented using an anchor element that triggers a download. We can now restore markdown by loading a downloaded file (in principle this should work for any plain text file).

One important thing to note here is that localStorage doesn't work in private browsing mode and its behaviour is not entirely consistent between browsers. So I wouldn't rely too much on it!

1 comments

That's pretty neat! You actually gave me an idea - it'd probably be neat to be able to export a note in HTML/MD.