Skip to content

Content Model to HTML is stripping trailing space. #3235

@BryanValverdeU

Description

@BryanValverdeU

Describe the bug
When loading the a model like below

{
    "blockGroupType": "Document",
    "blocks": [
        {
            "blockType": "Paragraph",
            "segments": [
                {
                    "segmentType": "Text",
                    "text": "Could you please provide more information ",
                    "format": {
                        "fontFamily": "Corbel, Skia, sans-serif",
                        "fontSize": "12pt",
                        "textColor": "rgb(94, 50, 124)"
                    }
                }
            ],
            "format": {
                "isProofing": true
            },
            "segmentFormat": {
                "fontFamily": "Corbel, Skia, sans-serif",
                "fontSize": "12pt",
                "textColor": "rgb(94, 50, 124)"
            }
        },
        {
            "blockType": "Paragraph",
            "segments": [
                {
                    "segmentType": "SelectionMarker",
                    "isSelected": true,
                    "format": {
                        "fontFamily": "Corbel, Skia, sans-serif",
                        "fontSize": "12pt",
                        "textColor": "rgb(94, 50, 124)"
                    }
                }
            ],
            "format": {
                "isProofing": true
            },
            "segmentFormat": {
                "fontFamily": "Corbel, Skia, sans-serif",
                "fontSize": "12pt",
                "textColor": "rgb(94, 50, 124)"
            }
        }
    ],
    "format": {
        "fontFamily": "'Corbel', 'Skia', sans-serif",
        "fontSize": "12pt",
        "textColor": "#5e327c"
    }
}

As you can see the paragraph has an ending space in the Text property, however when rendered that space is lost.
Image

Image

If instead of adding space adding a &nbsp fixes the issue:

Image Image

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. In the side pane select Import Model
  3. In the dialog paste the above model
  4. Press Ok and then Create DOM Tree

Expected behavior
The space at the end of the paragraph should be kept but currently is lost.

Screenshots
But rendered in correctly:

Device Information

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

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