Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Comment | File | Size | Author |
---|---|---|---|
#8 | ckeditor-media-embed-stripping-width-height-1635788-8.patch | 1.03 KB | vokiel |
| |||
#7 | media_embed_stripping_width-1635788-7.patch | 1.02 KB | rakenodiax |
|
Comments
Comment #1
wiifmSorry about the whitespace fixes in the patch, my editor trims them automatically ;)
Comment #2
mkesicki CreditAttribution: mkesicki commented@wiifm ,
thank you for your patch. We try to check it as soon as possible. Please be patient.
Comment #3
wiifmAny idea on how likely this is to be accepted? I would prefer to be able to roll with a standard (unpatched) install of ckeditor ;)
Comment #4
wiifmUploading a new version of the patch that is --relative (for drush make)
Comment #5
jddh CreditAttribution: jddh as a volunteer commentedI'm running into the same issue with version 7.x-1.16. For this version, I needed to patch the dialog JS instead—it was stripping out any number values that included px or &.
Comment #7
rakenodiax CreditAttribution: rakenodiax at Cellar Door commentedReroll #5 for latest 7.x-1.x-dev
Comment #8
vokielThe idea from #7 seems to be working just fine, although I think is too wide as
\S*
matches any non-whitespace character (equal to[^\r\n\t\f\v ]
).For the width/height we can have digits or digits with the unit, eg
width="300"
orwidth="0.50vw"
or eventuallywidth="50%"
.So there is a need just for:
[a-zA-Z0-9\.\%]
or even a whitelist of all possible units. That would require more updates though, so I would just stick to easier but not too wide regex.See attached proposal.
Comment #10
vokielComment #11
ron_s CreditAttribution: ron_s commentedWhile I understand the purpose of this patch from 9 years ago, I don't believe it has much value today.
Embedded media in modern websites should not have hard-coded width and height settings, otherwise it is impossible to properly scale on mobile devices. The much better approach is to standardized aspect ratios that will display correctly on any device size.
This can easily be done as a preprocess for any media such that it is seamless to content contributors.