Skip to content

[feature]: Render Mermaid diagrams in the rich text editor (code block live preview) #9786

Description

@Liewzheng
  • I have searched the existing issues

Summary

Render Mermaid diagrams in the rich text editor (work item descriptions, comments, pages): a code block with language mermaid shows a live-rendered diagram preview alongside the still-editable code — the same UX as GitHub/Notion.

Why should this be worked on?

Engineering teams keep architecture diagrams, flows and sequence charts next to the work item they describe. Today a ```mermaid block in Plane renders as plain code, so teams paste screenshots instead — un-editable, un-versioned, and quickly stale. Native rendering keeps diagrams as text: diffable, copy-pasteable, and editable in place.

Implementation notes (working PR attached):

  • Zero schema change: builds on the existing code-block node (language-mermaid class), so Markdown round-trip, HTML export and yjs collaborative editing all keep working untouched; server-side HTML sanitization already allows language-* classes.
  • mermaid (~350KB gzip) is loaded via dynamic import() only when a mermaid block is on screen — zero cost otherwise; SSR-safe.
  • Diagram follows the editor's light/dark theme; render errors show the source plus the parser message instead of breaking the editor; rapid typing is debounced.
  • Read-only surfaces (peek overview, space public pages) render the diagram automatically via the same node view.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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