#39837 closed defect (bug) (worksforme)
Random blank spaces appearing at end of lines
Reported by: | maliktunga | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.7.2 |
Component: | TinyMCE | Keywords: | |
Focuses: | Cc: |
Description
So far, I have encountered this issue only with the visual editor.
When I write in the visual editor, it often adds "ghost formatting" that makes it so that I get blank spaces a bit everywhere at the end of lines, while the next word(s) in the paragraph would totally fit in that blank space.
I have no knowledge in technical terms, so I will define those random blank spaces as "ghost formatting", since it seems to be integrated in the HTML code, yet it's invisible in the HTML editor.
I can easily find examples from my blog. However I am not sure that I can really share the broken HTML code, since in most text boxes the "ghost formatting" gets lost in the process...
This is the broken HTML code:
La <em>Kompleta Gramatiko</em> adaptis frazi ek verko qua esis obsoleta <em>de la komenco</em>! Beaufront adaptis la paragrafo por la nova verbi «mixita», ma semblas, ke lu ankore nesavis pri <b>ind</b>... Nam yen ke on ja trovis <b>honorinda</b>, <b>ridinda</b> e <b>shaminda</b> en la <em>Dictionnaire français-international</em> (1908)!
This is the fixed HTML code:
La <em>Kompleta Gramatiko</em> adaptis frazi ek verko qua esis obsoleta <em>de la komenco</em>! Beaufront adaptis la paragrafo por la nova verbi «mixita», ma semblas, ke lu ankore nesavis pri <b>ind</b>... Nam yen ke on ja trovis <b>honorinda</b>, <b>ridinda</b> e <b>shaminda</b> en la <em>Dictionnaire français-international</em> (1908)!
Fixing it is simple: I copy the paragraph, paste it in a text box that doesn't support the "ghost formatting" (e.g. Chromium's address bar) then copy and paste it back into the HTML editor. Somehow, the blank spaces disappear. However, that workaround easily gets tedious since I have to do it every time...
I attached a screenshot that shows how the two codes looks like on my blog and in the visual editor.
I use Chromium 55.0.2883.87 Built on Ubuntu , running on elementary 0.4 (64-bit).
Attachments (3)
Change History (7)
#2
@
8 years ago
From a friend who knows coding a bit more than I:
He says that there are five spaces in the broken code that are actually non-breaking spaces (C2A0). They seem to have been inserted before and after HTML tags.
#3
@
5 years ago
- Milestone Awaiting Review deleted
- Resolution set to worksforme
- Status changed from new to closed
there are five spaces in the broken code that are actually non-breaking spaces
Yes, this is the same feature (bug) in the browsers trying to keep empty spaces typed by the user in contenteditable. In some cases and in some browsers these invisible non-breaking spaces are inserted at many different places. Unfortunately it is impossible to "guess" whether the user intended to insert a
or the browser just added it, so fixing this is pretty hard/prone to edge cases.
This works much better in the block editor now. Closing as worksforme as it is the expected browser behaviour in contenteditable. Feel free to reopen with ideas about how to make it better in the classic editor, if still needed.
Comparison of the broken HTML code and the repaired HTML code