Skip to content

Feature: Show non-printing characters #8592

@levensta

Description

@levensta

Description

Inspired from #8519

Now that a generalized DOMSlot has been added to lexical and a powerful example of VisibleLineBreakExtension is available in the playground, it makes sense to expand its scope and implement a feature to display non-printing characters. This mode can be enabled in Google Docs and Word via a menu or keyboard shortcut, and certain whitespace characters will become visible. These mainly include:

  • Line break (Shift + Enter)
  • Paragraph mark (Enter)
  • Space ·
  • Tab

How it looks in Docs and Word
Image Image

In this mode, it is also useful to display ZWSP and WJ, which can be helpful for Asian languages but are also used in typography for other languages. The characters NBSP and SHY are also commonly used in typography, although they are no longer displayed in popular text editors

Impact

This is a particularly useful feature for visually distinguishing line breaks from blank paragraphs. Displaying the other characters is necessary for professional typography, when precise control over word breaks is required.

The most likely solution would be to create an extension in the playground and a button in the interface, since styling the characters requires CSS, which cannot be universal across all user editors

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovement over existing feature

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions