"Limit allowed HTML tags and correct faulty HTML" filter strips inline css.
I know actually that this is works as designed:
A list of HTML tags that can be used. By default only the lang and dir attributes are allowed for all HTML tags. Each HTML tag may have attributes which are treated as allowed attribute names for that HTML tag. Each attribute may allow all values, or only allow specific values. Attribute names or values may be written as a prefix and wildcard like jump-*. JavaScript event attributes, JavaScript URLs, and CSS are always stripped.
I think in several use cases it would be helpful if this filtering could be turned off for some html tags.
The method could be similar as any other parameter: specify style tag to a desired html element in the field Enabled filters
So e.g. this way could be enable inline css to table element:
<table style>
Comments
Comment #4
emil stoianov commentedI agree, the style attribute is a door for potential unsafe things and a beginning of things looking wired but this is a responsibility of the editor of the site and duty of the developer to rise awareness about it. No instrument is protected from miss use. There are a lot of things one can hit with a hammer besides nails
Having that in mind there is an approved list of the safe ones: https://validator.w3.org/feed/docs/warning/DangerousStyleAttr.html
The list:
azimuth, background, background-color, border, border-bottom, border-bottom-color, border-bottom-style, border-bottom-width, border-collapse, border-color, border-left, border-left-color, border-left-style, border-left-width, border-right, border-right-color, border-right-style, border-right-width, border-spacing, border-style, border-top, border-top-color, border-top-style, border-top-width, border-width, clear, color, cursor, direction, display, elevation, float, font, font-family, font-size, font-style, font-variant, font-weight, height, letter-spacing, line-height, margin, margin-bottom, margin-left, margin-right, margin-top, overflow, padding, padding-bottom, padding-left, padding-right, padding-top, pause, pause-after, pause-before, pitch, pitch-range, richness, speak, speak-header, speak-numeral, speak-punctuation, speech-rate, stress, text-align, text-decoration, text-indent, unicode-bidi, vertical-align, voice-family, volume, white-space, and widthThe generated styles by several CKEditor5 plugins are more or less fitting in the "safe"list.
Is it possible to make the above list be part of exceptions?
Comment #5
emil stoianov commentedMake it available for D^9.5.x
Comment #6
emil stoianov commentedComment #7
emil stoianov commentedChanging this to but report category as this is limiting CKEditor5 capabilities.
Comment #8
emil stoianov commentedComment #9
wim leersComment #10
davedg629 commentedI'd also like to see the exceptions listed in #4 added.
Comment #11
wim leersFYI: if you really really want inline styles:
Comment #12
wim leersComment #13
davedg629 commentedInteresting, thanks for the recommendation.
Comment #14
bramdriesenSetting to FR as this is currently clearly working as designed.
Comment #15
bramdriesen