This affects both markItUp and the newly added Epic Editor (#1732880: Implement EpicEditor) or every filter that uses the Markdown filter

See here:

When you do want to insert a <br /> break tag using Markdown, you end a line with two or more spaces, then type return.

So it basicly works like this:

Foo\s\s\nbar

will be converted by markdown to this

Foo<br/>bar

but the wysiwyg-module apparently preprocesses it to

Foo\s\nbar

which will be converted to this by markdown:

Foo bar

so it appears like multiple spaces get collapsed to single one which breaks the logic of markdown

Comments

sun’s picture

Status: Active » Postponed (maintainer needs more info)

I don't believe that Wysiwyg module is touching the actual content in any way.

Can you prove that?

I'd rather guess that jQuery might be internally touching/rewriting text nodes, but it could as well be something completely different.

loominade’s picture

Title: corrupts markdowns logic of hard breaks » corrupts markdown's logic of hard breaks

what do you mean?

jQuery's .val(). returns and sets plain text as it is. Double spaces included. I just tried

so i thought wysiwyg performs some kind of cleanup

TwoD’s picture

Does the markup look alright if you click "Disable rich-text" after inserting it into the editor?
I would assume the editor itself would remove duplicated whitespaces (I'm surprise the \s\s\n wasn't just reduced to \n or simply considered source-code formatting and removed.

Editors frequently remove whitespaces since they have no meaning in HTML when repeated. It's also difficult to preserve whitespaces across browser since they don't care much about them either, once the markup has been converted to a DOM tree. When serializing the DOM inside the editing area to markup again, most editors I've seen skip text nodes with just whitespaces and put in their own based on some source formatting rules handed to the via settings or builtin.

TwoD’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Without further details about the problem I can only close this issue. Please re-open it if you can provide the requested information.