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

The supportAllValues doesn't work with nested elements #8233

Closed
jswiderski opened this issue Oct 9, 2020 · 3 comments · Fixed by #8454
Closed

The supportAllValues doesn't work with nested elements #8233

jswiderski opened this issue Oct 9, 2020 · 3 comments · Fixed by #8454
Assignees
Labels
package:font squad:core Issue to be handled by the Core team. support:2 An issue reported by a commercially licensed client. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@jswiderski
Copy link

📝 Provide detailed reproduction steps (if any)

  1. Use the following configuration for FontSize plugin:
fontSize:  {   
options: [ 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72 ],   
supportAllValues: true   
}
  1. Open editor with the following content:
<p style="text-align:center"><span style="font-size:28px">APPROVED</span></p>
<p style="text-align:center"><span style="color:#27ae60"><em style="font-style: italic;"><strong><span style="font-size:28px">APPROVED</span></strong></em></span></p>

✔️ Expected result

Since supportAllValues is used, nested span with font-size:28px should be retained in both cases.

❌ Actual result

The nested span with font-size:28px is getting removed from the second paragraph.

Even after creating a custom plugin (I can attach it if necessary) which retains elements (ok, I have changed the i into styled span ), their order and overwrites the font-size plugin default converter, there result is still the same:

The only solution is removing supportAllValues: true .

NOTE: This could be a duplicate of #7965

📃 Other details

  • Browser: Any
  • OS: Any
  • CKEditor version: 23.0.0
  • Installed CKEditor plugins: FontSize

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@jswiderski jswiderski added type:bug This issue reports a buggy (incorrect) behavior. support:2 An issue reported by a commercially licensed client. package:font labels Oct 9, 2020
@Reinmar
Copy link
Member

Reinmar commented Oct 12, 2020

This is the minimal markup to reproduce this issue:

OK:
<p><span style="font-size:28px">APPROVED</span></p>
NOK:
<p><span style="color:#27ae60"><span style="font-size:28px">APPROVED</span></span></p>

And it indeed does not work only if supportAllValues is set to true 🤔 .

@Reinmar Reinmar added the squad:core Issue to be handled by the Core team. label Oct 12, 2020
@Reinmar Reinmar added this to the nice-to-have milestone Oct 12, 2020
@AnnaTomanek AnnaTomanek modified the milestones: nice-to-have, iteration 38 Oct 26, 2020
@psmyrek
Copy link
Contributor

psmyrek commented Nov 13, 2020

Even simpler minimal failing markup:

<p><span><span style="font-size:28px">This text should have 28px font size...</span></span></p>

pomek added a commit that referenced this issue Nov 16, 2020
@dkrahn
Copy link
Contributor

dkrahn commented Jan 26, 2021

Still does not work with nested elements, for example, inside a table cell.

OK:
<p><span style="font-size:28px">APPROVED</span></p>
NOK:
<figure class="table"><table><tbody><tr><td><span style="font-family:'Courier New', Courier, monospace;">APPROVED</span></td></tr></tbody></table></figure>

The test I did was today(2021-01-26 10:30) accessing https://ckeditor.com/ckeditor-5/demo/#document

  1. In the editor, I cleared it and added a table with one cell and the text applying the Courier font.
  2. In the console, I executed the following:
editors[0].setData(editors[0].getData())

Result: The font family is lost. As is the font-size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:font squad:core Issue to be handled by the Core team. support:2 An issue reported by a commercially licensed client. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants