Opened 9 years ago
Closed 9 years ago
#28993 closed defect (bug) (fixed)
<img> srcset attribute is stripped when switching from text to visual tab in the editor
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | normal | Version: | 3.9.1 |
Component: | TinyMCE | Keywords: | |
Focuses: | Cc: |
Description
Going to the "text" tab to add srcset attribute (manually) to the image, and then going to "visual" tab results in that attribute being stripped out.
Attachments (1)
Change History (11)
#2
@
9 years ago
+1 to this -- now that the spec is settled and support is out in the wild in FF and Chrome, I'd love to be able to start using srcsets natively.
#3
@
9 years ago
+1
I think this issue should probably be fixed upstream in TinyMCE itself - I have opened a pull request on github to add this - https://github.com/tinymce/tinymce/pull/428
In the mean time - heres a patch that fixes it.
Note - I have also done this in the past by adding it to valid_elements
using the tiny_mce_before_init
filter, but I think it would be best to avoid doing this in core.
#4
@
9 years ago
Also opened PR for TinyMCE for picture element support as this is related: https://github.com/tinymce/tinymce/pull/429
#6
@
9 years ago
Currently there is partial support for srcset
, although most browsers that run on high pixel density devices support it. Asked upstream.
However only Chrome and Opera support <picture>
(no mobile browsers support), and it seems it still has some problems/uncertainties. Perhaps better to wait few more months before trying to use it.
#7
@
9 years ago
We merged in both pull requests. So srcset and picture elements should work as of 4.1.7. Thanks mattheu for helping out.
#8
@
9 years ago
- Milestone changed from Awaiting Review to 4.1
Thanks @spocke. This will be in WordPress 4.1 after we update TinyMCE.
I can confirm this occurs on a clean install of 4.0