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

bold and italic formating is lost #25

Closed
pbauer opened this issue Mar 15, 2023 · 0 comments
Closed

bold and italic formating is lost #25

pbauer opened this issue Mar 15, 2023 · 0 comments

Comments

@pbauer
Copy link
Member

pbauer commented Mar 15, 2023

In older Plone-Versions it was the default by TinyMCE to style bold or italic text like this:

<p>Normal Text <span style="font-weight: bold;">Bold Text</span> more normal text</p>

Converting this results in:

{'@type': 'slate',
 'plaintext': 'Normal Text Bold Text more normal text',
 'value': [{'children': [{'children': [{'text': 'Normal Text '}], 'type': 'span'},
                         {'children': [{'text': 'Bold Text'}], 'type': 'span'},
                         {'children': [{'text': ' more normal text'}], 'type': 'span'}],
            'type': 'p'}]}
  1. All three text-parts are turned into spans which leads to ugly line-breaks in Volto.
  2. The styling is gone

It would be better to create this:

{'@type': 'slate',
 'plaintext': 'Normal Text Bold Text more normal text',
 'value': [{'children': [{'text': 'Normal Text '},
                         {'children': [{'text': 'Bold Text'}], 'type': 'strong'},
                         {'text': ' more normal text'}],
            'type': 'p'}]}

The same goes for <span style="font-style: italic">Italic text</span> which should get 'type': 'em'.

@ericof ericof closed this as completed in 33a29e9 Mar 16, 2023
ericof added a commit that referenced this issue Mar 16, 2023
Fix #25 by handling TinyMCE styling for strong and emphasis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant