Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New line always added on save #8

Open
adi- opened this issue Sep 19, 2014 · 3 comments
Open

New line always added on save #8

adi- opened this issue Sep 19, 2014 · 3 comments

Comments

@adi-
Copy link

adi- commented Sep 19, 2014

I have noticed some issues while saving/opening documents written in EpicEditor. Editor is always adding break tag to each line of text on open.

Do you know any workarounds? Can it be fixed in Django or is it EpicEditor's issue that you can't fix in django-epiceditor?

@CapnKernel
Copy link

I'm also having this problem. My markdown gets longer and longer every time it's saved.

For example, here's the markdown (see the last field):

(env)[mjd@green hv]$ mysqldump --skip-extended-insert -t --compact --where 'id = 3' -u root -p$PP db notes_note
INSERT INTO `notes_note` VALUES (3,'f7vFniFaQcm+BiPxWQ0jKQ','foo1','foo1','abc\ndef\n');

On the admin page, it looks like this, in the black edit field:

abc
def

If I click "Save and continue editing", the text in the black field doesn't change, but it changes in the DB:

(env)[mjd@green hv]$ mysqldump --skip-extended-insert -t --compact --where 'id = 3' -u root -p$PP db notes_note
INSERT INTO `notes_note` VALUES (3,'f7vFniFaQcm+BiPxWQ0jKQ','foo1','foo1','abc\r\ndef\r\n');

The \n was replaced with \r\n.

If I click "Save and continue editing", the DB has changed again:

(env)[mjd@green hv]$ mysqldump --skip-extended-insert -t --compact --where 'id = 3' -u root -p$PP db notes_note
INSERT INTO `notes_note` VALUES (3,'f7vFniFaQcm+BiPxWQ0jKQ','foo1','foo1','abc\r\n\r\ndef\r\n\r\n');

Then if I reload the admin page, the black edit field looks like this:

abc

def

I'd really like to see a fix for this bug please! (Platform: Fedora 20 Linux, mysql)
(suggestion: Check the POST data when the page is saved. The RFC for POST data may require that newlines be sent as \r\n)

adi-: Is this the same bug you're seeing?

@adi-
Copy link
Author

adi- commented May 2, 2015

Yeap, the same. I haven't found a workaround for EpicEditor, so I wrote my own. If you are interested check https://github.com/adi-/django-markdownx

@barraq
Copy link
Owner

barraq commented May 2, 2015

Hi @adi- and @CapnKernel thanks for reporting this. I am no longer using Django.... I've migrated most of my stuff to Rails (when I needed server side dynamics) or static generator like Nanoc for all the rest.

Is your issue related to OscarGodson/EpicEditor#171 or OscarGodson/EpicEditor#363 ? If the bug is coming from EpicEditor then this issue must be reported there; otherwise a patch can be provided, as @CapnKernel propose, by checking the post data e.g. providing a clean_YOURFIELD method which would handle those bad carriage return lines....

@CapnKernel a patch is welcome then :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants