Skip to content

Overview: RichText, APIs, & Formatting Library #13778

Closed

Description

Just wanted to make part of my to do list for the Rich Text package public so it is out there and people can help if they'd like, add items, etc. This is a bit of a "living issue".

Formatting Library

  • Text colour. (Not sure if @gziolo has anything it merge.)
  • (Foot)notes.
  • Checklist button in the list block.
  • Mentions rewrite.

Roadmap

  • Make RichText a completely controlled component. This means that the current value is continuously applied to the DOM, without exception.
  • Use React to render the rich text tree (and take advantage of its diffing). Currently we build a DOM tree and diff it ourselves. The challenge here will be the selection, but I have some ideas. Another challenge will be that the DOM can be changed by the browser in a way that React is not expecting. I've encountered errors in previous attempts, and I'm unsure how to solve it.
  • API for rendering more complex structures in RichText with React, probably as a save method in the format type object.
  • Add an <Autocomplete> component that can be used by formats. This can help us move mentions to the format library, but is also very useful for plugins.
  • API for inserting or replacing content at the caret on input. The "text patterns" need to be moved to the format library.
  • Stabilise API to apply formatting on editable tree creation, used by e.g. annotations, spell checking, visualising invisible characters...
  • Introduce a way to manage focus on the RichText editor. (Introduce a way to manage focus on the RichText editor #9740)

Low priority

  • I would love to eventually move wptexturize into RichText. It makes the visual editor more visual, and it allows the user to undo it. It would also solve long standing bugs with wptexturize where it is not able to handle HTML tags well. In rich text values, text and formatting are separated, so it's fairly easy to implement.
  • Visualise unknown tags/formatting.
  • Visualise invisible characters like non breaking spaces.
  • Hopefully at some point the list block could be rewritten to use a RichText instance per list item. I think this would be needed if we ever want to add movers per list item. This seems low priority though. See List Block: Try nesting with InnerBlocks #6394.
  • Rewrite the quote blocks to use nested blocks, so they can contain lists etc. This would also help reduce the complexity of RichText, although I'm fine with keeping multiline capabilities.
  • Find ways to make toTree faster.

Docs

  • Add more inline documentation where they are lacking.
  • Explain how the rich text value works.
  • Add more examples of capabilities.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

[Feature] Rich TextRelated to the Rich Text component that allows developers to render a contenteditable[Package] Format library/packages/format-library[Package] Rich text/packages/rich-text[Type] OverviewComprehensive, high level view of an area of focus often with multiple tracking issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions