Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removeFormat won't remove span if lang attribute is present #5359

Closed
superedo73 opened this issue Oct 25, 2022 · 2 comments
Closed

removeFormat won't remove span if lang attribute is present #5359

superedo73 opened this issue Oct 25, 2022 · 2 comments
Labels
resolution:by-design Described behavior is a part of feature design and is not expected to be changed. type:bug A bug.

Comments

@superedo73
Copy link

removeFormat won't remove span tags if lang attribute is present. Indeed, dir attribute is added too.

Pressing the removeFormat button won't either remove the span tag or the lang and dir attributes.

Without the lang attribute all is working as expected (span is removed)

Here my relevant conf:

removeFormatTags = 'cite,code,del,dfn,font,ins,kbd,q,samp,span,strike,tt,var',
removeFormatAttributes = 'class,style,lang,width,height,align,hspace,valign,dir',

Other details

  • Browser: Chrome
  • OS: Windows 10
  • CKEditor version: 4.19.1
@superedo73 superedo73 added the type:bug A bug. label Oct 25, 2022
@Comandeer
Copy link
Member

This is an intended behavior as the language indication is not considered a formatting – it does not convey information about styling. See #779 for more details.

However, particular filters can be disabled to allow deleting language indication via the "Remove Format" plugin → https://jsfiddle.net/Comandeer/ew46mx35/ It's not a recommended and official solution (as the CKEditor 4 does not expose any public API for it) yet it's possible.

@Comandeer Comandeer closed this as not planned Won't fix, can't repro, duplicate, stale Oct 26, 2022
@Comandeer Comandeer added the resolution:by-design Described behavior is a part of feature design and is not expected to be changed. label Oct 26, 2022
@superedo73
Copy link
Author

superedo73 commented Oct 27, 2022

Thank you very much. Ok about preserving language indication.

Anyway, I think removeFormat should at least remove the style attribute (carrying font, text, color and other formatting infos), but when lang attribute is present, no other attribute check/removal seems performed.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution:by-design Described behavior is a part of feature design and is not expected to be changed. type:bug A bug.
Projects
None yet
Development

No branches or pull requests

2 participants