OscarGodson / EpicEditor

EpicEditor is an embeddable JavaScript Markdown editor with split fullscreen editing, live previewing, automatic draft saving, offline support, and more. For developers, it offers a robust API, can be easily themed, and allows you to swap out the bundled Markdown parser with anything you throw at it.
http://epiceditor.com
MIT License
4.25k stars 334 forks source link

Initialising editor with CR LF causes two extra spaces #363

Open matthewbloch opened 9 years ago

matthewbloch commented 9 years ago

I've been using EpicEditor as a souped-up textarea, like this:

var editor = new EpicEditor({
    textarea: "approach_cover_letter",
    clientSideStorage: false,
    basePath: '',
    container: 'cover_letter_editor',
}).load();

i.e. I'm not using the localstorage option, and am just using the synchronised data as part of a normal form submission in Rails.

So I've encoded my form value in that defaultContent, but I find that CR LF is replaced by "CR LF SPACE SPACE", so round trips keep adding more and more spaces.

I can avoid this by stripping the CRs on submission, but it seemed like an obvious enough workflow with an odd-enough side effect that it might be considered a bug :)