Opened 9 years ago
Closed 5 years ago
#34181 closed defect (bug) (maybelater)
on a <td> disappearing when switching from Text to Visual tab
Reported by: | Inggo | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.3.1 |
Component: | TinyMCE | Keywords: | |
Focuses: | Cc: |
Description
If I have this on the "Text" tab of TinyMCE:
<table> <tr> <td> </td> </tr> </table>
And switch to the "Visual" tab, then switch back to "Text", the
on the <td>
disappears. Output becomes:
<table> <tbody> <tr> <td></td> </tr> </tbody> </table>
Change History (5)
#2
@
9 years ago
- Summary changed from on a <td> disappearing when switching from to on a <td> disappearing when switching from Text to Visual tab
This ticket was mentioned in Slack in #core-editor by iseulde. View the logs.
8 years ago
#4
@
8 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Future Release
Thanks for the report!
Seems to be related to autop in JS. Also creating a table in the text editor without spaces will get spaces when switching to the visual editor.
Needs tests.
#5
@
5 years ago
- Resolution set to maybelater
- Status changed from new to closed
Yes, this comes from the js autop. The
is converted to U+00A0 by TinyMCE (it is set to do that), and U+00A0 is matched by \s
in the autop regex.
The way this can be fixed is perhaps to look at "empty" <td>{U+00A0}</td>
and replace the UTF-8 char with the entity after the TinyMCE cleanup but before autop. Potentially this may bring some edge cases on the front-end, in the PHP autop.
On the other hand this is superseded by the block editor. The Table block there works well and doesn't seem to have this problem, so not sure if it's worth it fixing for the classic editor.
Closing as maybelater. Feel free to reopen is this is still needed/has common use cases.
Related: #20943