Skip to content

bold and italic formating is lost #25

@pbauer

Description

@pbauer

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'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions