#22175 closed defect (bug) (fixed)
Switching to Visual Editor strips table attributes
Reported by: | batmoo | Owned by: | azaozz |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | blocker | Version: | 3.5 |
Component: | TinyMCE | Keywords: | |
Focuses: | Cc: |
Description
- Add or Edit a Post
- Switch to HTML editor
- Insert a table like below
- Switch to Visual Editor
- Switch back to HTML editor
- Table attributes have been stripped:
<table border="0">
Example table:
<table border="0" align="left" cellspacing="0" cellpadding="0" width="100%"> <tbody> <tr> <td>Hello</td> </tr> </tbody> </table>
Attachments (2)
Change History (18)
#3
@
12 years ago
align
, cellspacing
, cellpadding
, and width
attributes are listed as obsolete:
http://www.w3.org/TR/html-markup/table.html
#5
@
12 years ago
Appears to be a regression caused by switching TinyMCE's schema to 'html5' in [21875].
#6
follow-up:
↓ 8
@
12 years ago
Yeah, ideally, schema => html5 should make TinyMCE more liberal in every way. It should not remove deprecated or removed elements or attributes.
What bothers me is that the 'schema' attribute is new. If this was a design decision rather than a side effect, we should have a conversation with TinyMCE about working towards avoiding data destruction for future development.
#8
in reply to:
↑ 6
@
12 years ago
Replying to nacin:
What bothers me is that the 'schema' attribute is new. If this was a design decision rather than a side effect, we should have a conversation with TinyMCE about working towards avoiding data destruction for future development.
Is someone having this discussion with TinyMCE? Or should we patch up a workaround for now?
#9
@
12 years ago
Did some more research about old/obsolete HTML3 attributes. They only work if the element has no css styling. On top of that some obsolete attributes are ignored as soon as any css styling is applied, even when there is no direct css style that replaces them.
In that terms we are not talking about "loosing data" but rather about preserving obsolete code that introduces inconsistencies.
Since tables were used mostly for layout, the behaviour of obsolete attributed is more consistent there. Perhaps they should be treated as special case. We can set TinyMCE to allow all HTML attributes on them.
#10
@
12 years ago
22175.patch overrides the internal cleanup in TinyMCE for <table> allowing all attributes.
#12
@
12 years ago
Still looking at that. Another obsolete attribute we should probably allow is <a name="...">. Seems a lot of users are still trying to use old style anchors. There's no good way to do that from the settings, will patch tiny_mce.js.
#13
@
12 years ago
22175-1.patch adds the obsolete table attributes and <a name>
to the html5 schema in TinyMCE using the 'wordpress' plugin. It also allows for this to be disabled from the init array.
#14
@
12 years ago
- Owner set to azaozz
- Resolution set to fixed
- Status changed from new to closed
In 22411:
#15
@
12 years ago
As discussed in #wordpress-dev removed the extra setting to disable this. Can be overwritten from another MCE plugin if needed.
Previously: #13314