Skip to content

fix(editor): preserve code languages in Live imports - #9816

Open
rclod wants to merge 1 commit into
makeplane:masterfrom
rclod:fix/live-code-language-import
Open

fix(editor): preserve code languages in Live imports#9816
rclod wants to merge 1 commit into
makeplane:masterfrom
rclod:fix/live-code-language-import

Conversation

@rclod

@rclod rclod commented Sep 11, 2026

Copy link
Copy Markdown

Description

Plane Live now preserves code-block language metadata when it imports HTML into Yjs. The server-side DOM implementation does not populate firstElementChild as the browser does, so language-* classes were dropped during the first collaborative-editor load even when the submitted HTML was correct.

This is useful for every syntax-highlighted code block and lets the Mermaid renderer in #9787 recognize agent-authored language-mermaid blocks after Live conversion.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Not applicable; this fixes server-side document conversion.

Test Scenarios

  • Added an HTML → Yjs → JSON/HTML regression test for language-mermaid.
  • pnpm turbo run build --filter=live (10/10 tasks).
  • Live tests (3 files, 33 tests), type-check, lint (6 existing warnings, 0 errors), and format checks.
  • Deployed the same change on a Plane CE v1.4.2 instance and verified production Live conversion preserves language="mermaid" for state, flowchart, and sequence diagrams.

References

Related: #9787

Use a zeed-dom-compatible lookup when Plane Live converts API-authored HTML
into Yjs state, and cover the complete conversion round trip.
@coldtea-pr-lens

coldtea-pr-lens Bot commented Sep 11, 2026

Copy link
Copy Markdown

◈ PR Lens

🟢 +0 new · 🟠 ~2 changed · 🔴 -0 removed · 1 flow · 2 files · commit b448751


Architecture

Architecture diagram for makeplane/plane at b448751

2 components touched across 2 lanes.

Open the interactive canvas


Data flow

Data flow diagram for makeplane/plane at b448751

Parsing code block language from HTML

Open the interactive canvas


View

  • Architecture lens
  • Data flow lens
  • Expand every detail

Tip

The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change.

🪧 More tips
  • Run npx skills add coldteadotai/pr-lens, then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."
  • Run npx @coldtea/pr-lens-cli analyze --base origin/main on a branch, then npx @coldtea/pr-lens-cli render .pr-lens/graph.json. Same lenses, your own model key, before the pull request exists.
  • Untick Architecture lens or Data flow lens under View to hide a diagram, or tick Expand every detail to open every section. The comment redraws in a few seconds.
  • Click the link under each diagram to open it on a canvas you can zoom, pan and step through.
  • Open a diagram on the canvas, then press W or click play to walk through the change one step at a time.
  • The CLI's render reads .github/pr-lens.yml and applies your renames, exclusions and lane pins at draw time.
  • Set github.comment.collapsed: true in .github/pr-lens.yml to fold the comment behind one View architecture and data flow row. Drawing still runs on every push.
  • Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and your model provider's key as its api-key to run PR Lens from your own CI. Any /chat/completions endpoint works.
  • Push a commit and the comment redraws for the new head. A slow older run never overwrites a newer one.
  • Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion.

Thanks for using PR Lens! It's built by Coldtea, free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 17d366da-6afc-409d-b88f-8acfc3897afa

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant