Opened 11 years ago
Closed 11 years ago
#28951 closed defect (bug) (fixed)
Caption shortcode `class` attribute stripped by TinyMCE
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | 3.9.1 |
Component: | Editor | Keywords: | dev-feedback has-patch |
Focuses: | javascript, administration | Cc: |
Description (last modified by )
A class attributed is listed as supported in the Codex and it looks like support was added in [27404]. But, if I add one manually in text view, and switch back to the visual editor, the attribute is stripped.
Unfortunately, I'm not familiar enough with the WP internal javascript to pinpoint exactly where this is happening.
Attachments (2)
Change History (13)
#3
@
11 years ago
- Keywords dev-feedback added; needs-patch removed
This is my first patch touching Javascript. Not sure this approach is acceptable, but worth a try.
This ticket was mentioned in IRC in #wordpress-dev by DrewAPicture. View the logs.
11 years ago
#7
@
11 years ago
- Owner set to azaozz
- Status changed from new to reviewing
This looks pretty good at a glance. If we're gonna introduce a new var here, can we at least use a complete word instead of another cryptic abbreviation? Any input @azaozz?
This ticket was mentioned in IRC in #wordpress-dev by knutsp. View the logs.
11 years ago
@
11 years ago
Alter existing patch to use "align" instead of "aln", and make alignment class regex case-insensitive
This ticket was mentioned in IRC in #wordpress-dev by kadamwhite. View the logs.
11 years ago
#10
@
11 years ago
This patch looks good, but I've altered the name of the new variable to be align
(for readability); made the regex for the alignment class case-insensitive; and standardized the whitespace around + operators within the lines touched by the path.
The reasoning for making the regex case-insensitive is that putting in mis-cased values into the 'align' attribute was causing an issue where the invalid attribute value and "wp-class" would get inserted into the user's shortcode class attribute value. Invalid alignment values (e.g. align="sideways"
) will still trigger this behavior, and that may be inevitable, but making the regex case-insensitive was a quick way to mitigate it without altering the functionality of the patch.
Confirmed.