how to load and save rich text format file

I am using codemirror and electron to write a rich text format editor,but how to save the rich text into a file(including bold/italic/underline…)
and loading it.

because the text in textarea is plain text ,so I can’t get the rich text effect

I had try to save the html segment to a file

       data = $(".CodeMirror-code").html();

//here save data to a local file

but when I read it from file,it looks well (including all the rich formating text)
but I can’t edit any more

1 Like

you can look at Firepad serializeHtml function for inspiration …