Opened 10 years ago
Closed 9 years ago
#31255 closed defect (bug) (fixed)
Remove space from empty paragraphs
Reported by: | iseulde | Owned by: | azaozz |
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | TinyMCE | Keywords: | has-patch |
Focuses: | Cc: |
Description
I remember we fixed this in #28282, but this problem popped up again. Not sure where exactly <p></p>
is replaced with <p> </p>
again. Maybe just better to add a <br>
.
Attachments (1)
Change History (14)
This ticket was mentioned in Slack in #core by iseulde. View the logs.
10 years ago
#4
@
10 years ago
@danielbachhuber Can you share a Google Doc that's causing problems so I can try to reproduce? I'm not entirely sure if this is a related problem.
#5
@
10 years ago
Thats interesting, and a TinyMCE problem it seems. Can't reproduce this in a plain contenteditable field.
The problem here is that strong tags are inserted, not that there is an empty line. You're separating paragraphs in the Google Doc with an empty line, while it might be better to add whitespace at the bottom or top of paragraphs instead (see Format => Line spacing => Add space after paragraph). So TinyMCE is correctly adding an empty line between the paragraphs. The weird thing is the strong tags being added with a space in between... I'll take a look at what might be causing it and otherwise ping spocke.
This ticket was mentioned in Slack in #core by drew. View the logs.
9 years ago
#8
@
9 years ago
- Owner set to azaozz
- Status changed from new to reviewing
@azaozz: Mind taking a look at 31255.patch and making a recommendation for commit or punt?
@iseulde: Is there a corresponding GitHub issue or similar for the problem you reached out to Spocke about?
#9
@
9 years ago
- Milestone changed from 4.2 to Future Release
I bet this is the same Chrome/WebKit "feature" that inserts thousands of "pesky" spans on paste :)
This time it seems to replace style="font-weight: bold"
with <b>
that gets converted to <strong>
by TinyMCE... The fix is: don't use Chrome to copy and paste from other web pages!
It is unfortunate that there are open tickets for that unexplainable behavior both for Chromium and WebKit, but they don't get any attention :(
#10
follow-up:
↓ 11
@
9 years ago
- Milestone changed from Future Release to 4.2
@azaozz: The Google Docs issue is not the main issue, it was thought it was related. So moving back to 4.2.
@danielbachhuber: This should be fixed now in trunk: https://github.com/tinymce/tinymce/commit/0a8cd0a67702f17e1281b4bb513b2238fe4fdd39
#11
in reply to:
↑ 10
@
9 years ago
- Resolution set to fixed
- Status changed from reviewing to closed
Replying to iseulde:
Hmm, I think that happens sometimes in a "plain" contenteditable div too, seen in Chrome. Depends on the differences in styles between the place the text is copied from and the contenteditable. Chrome certainly converts <b>
to <span style="font-weight: bold;">
in some cases, think it can convert it the other way round too.
Testing a bit more, this seems prevented in TinyMCE as the pasted HTML is cleaned before inserting it in the editor.
In any case, can close as fixed with the update to the latest TinyMCE version, [31700].
Google Docs is adding this on copy and paste: https://dl.dropboxusercontent.com/s/4zu1ykpm2c40ouf/2015-02-10%20at%2010.38%20AM%202x.png?dl=0
Maybe we can expand to more HTML characters that include some empty space.