peggyjs / peggy

Peggy: Parser generator for JavaScript
https://peggyjs.org/
MIT License
968 stars 65 forks source link

Save grammar and test input in online version to localStorage #186

Open zocky opened 3 years ago

zocky commented 3 years ago

It would be very nice if the online version retained its state between reloads, closed an reopen windows, etc. All that needs to be done is to save the grammar and input to localStorage on change and set them from localStorage on load.

hildjj commented 3 years ago

I like this idea, but want to think about how it would interact with #179.

zocky commented 3 years ago

IMO, the URL shouldn't update automatically. It's not needed for remembering the state, though it may be useful for sending links, e.g. in an email. You could have a button that copies the URL with encoded content to the clipboard.

Then, on load: