Skip to content

Preserve trailing white spaceΒ #3312

@pabzm

Description

@pabzm

Describe the bug

Currently the tui.editor removes trailing whitespace from markdown input when it's converted to HTML.

I'm building a plugin for https://github.com/roundcube/roundcubemail, in which tui.editor shall be used to compose emails. In those, some people use email signatures, which are delimited by \n-- \n from the content part of the message. The trailing blank character is relevant in this case, but tui.editor removes it.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://ui.toast.com/tui-editor
  2. Enter -- (dash dash blank) into the demo editor.
  3. Inspect the rendered HTML in the preview area using your browser's DevTools to notice that the trailing blank is removed.
  4. Notice that after switching to the WYSIWYG-tab, and then back to the Markdown-tab, the trailing blank is also removed in the markdown source.

Expected behavior

The whitespace should be preserved.

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions