Ticket #4710 (closed Bug: worksforme)
Spurious table at end of input after trimming whitespace around table
|Reported by:||SilenceIT||Owned by:|
A spurious table appears at end of input after trimming whitespace around a table (one created with intention of being the only content within the editor). Extra lines can also appear before and after.
Happens on ckeditor.com/demo: Yes
Tested browsers: Firefox 3.0.14/Lin, Internet Explorer 6-8/Win, Chromium 188.8.131.52 (28958)/Lin
Tested CK versions: 3.0, 3.0.1
Affects: All except maybe Chromium; See note in steps.
Workarounds: So long as the user is aware of this bug, in most cases it's possible to trim out the extra content and save it as-is, so long as editor is not re-rendered. However, the moment the content is edited again, extra lines will reappear.
Steps to reproduce:
- Start with a blank editor or with data already present; Remove all text.
- Add a table, the default 3x2 will do fine, and add text into each cell.
- Select middle row, center the text. In Fx, this causes a strange (but temporary) rendering issue.
- Rerender the editor (either via source/un-source or by saving/re-editing or what have you).
- Note there's an extra line before the table. Remove it. In IE, the line itself refuses to go away. In Chromium, you would have to ADD the line before this bug happens.
- View the source; There is now a blank, invisible table at the end of the HTML source (In IE7, there's also a bunch of other cruft). There's also a blank line before the table again.
(Some steps may be spurious, but these make it happen all the time. I've had it happen just placing the table and removing the extra line that happens right then.)
This does not seem to occur (at least in Fx3) if the configuration is modified as follows:
config.enterMode = CKEDITOR.ENTER_BR;
config.shiftEnterMode = CKEDITOR.ENTER_P;
However, the extra <br> below the table can never be removed in this configuration.
This table is a problem due to other renderers (e.g. Word) seeing it and displaying it, particularly if the original table's attributes (such as border colour) were changed.