Skip to content

Removed mobiledoc rendering and HTML-to-mobiledoc conversion#28906

Draft
kevinansfield wants to merge 1 commit into
mainfrom
confident-ramanujan-83db83
Draft

Removed mobiledoc rendering and HTML-to-mobiledoc conversion#28906
kevinansfield wants to merge 1 commit into
mainfrom
confident-ramanujan-83db83

Conversation

@kevinansfield

@kevinansfield kevinansfield commented Jun 25, 2026

Copy link
Copy Markdown
Member

ref https://linear.app/ghost/issue/GVA-816

Ghost moved to Lexical years ago, but ghost/core still carried two legacy mobiledoc paths that only ran for rare edge cases:

  • HTML → mobiledoc?source=html (and data import) converted incoming HTML to mobiledoc
  • mobiledoc → HTML — content stored only as mobiledoc had its HTML (re)generated by rendering the mobiledoc directly

Both relied on @tryghost/html-to-mobiledoc and @tryghost/kg-mobiledoc-html-renderer, which keep mobiledoc-kit in the dependency tree.

This drops both paths:

  • HTML input now always converts to Lexical.
  • Any content still stored as mobiledoc is converted to Lexical (via @tryghost/kg-converters) and then rendered, leaving a single rendering path. Posting mobiledoc to the API or importing a legacy mobiledoc export is accepted and auto-converted to Lexical on save (importing runs the cleaned mobiledoc through the model's normal conversion path).
  • Removes @tryghost/kg-mobiledoc-html-renderer, @tryghost/html-to-mobiledoc and @tryghost/kg-default-atoms, removing mobiledoc-kit from ghost/core's dependency tree.

Mobiledoc is still stored for legacy posts — the columns, mobiledoc_revisions table, snippet mobiledoc and URL transforms are untouched, so existing mobiledoc content keeps working. Only the conversion and rendering paths are removed.

Behavioural consequences worth calling out:

  • Because mobiledoc input is converted to Lexical on save, mobiledoc revisions are no longer created for new content (Lexical/post revisions are created instead).
  • The mobiledoc-only populateImageSizes step (which filled in image dimensions on force_rerender) no longer applies; Lexical relies on editor-stored dimensions.

Also fixes a latent connection-pool deadlock in the post model's revision path that surfaced once more content became Lexical (getOwnerUser was called without the surrounding transaction).

no ref

- Ghost moved to Lexical years ago but kept two legacy mobiledoc paths alive: converting HTML to mobiledoc (via ?source=html and on import) and rendering stored mobiledoc to HTML. These only ran for rare edge cases yet forced the mobiledoc-kit based dependencies to stay installed.
- HTML now always converts to Lexical, and any content still stored as mobiledoc is converted to Lexical (via @tryghost/kg-converters) before rendering, leaving a single rendering path.
- This drops @tryghost/kg-mobiledoc-html-renderer, @tryghost/html-to-mobiledoc and @tryghost/kg-default-atoms, removing mobiledoc-kit from ghost/core's dependency tree.
- Mobiledoc is still stored for legacy posts; only the conversion and rendering paths are removed, so existing mobiledoc content keeps working.
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1c821172-11e9-4e8e-986c-701ffa2637b4

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch confident-ramanujan-83db83

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

@github-actions github-actions Bot added the migration [pull request] Includes migration for review label Jun 25, 2026
@sagzy sagzy self-assigned this Jun 25, 2026
@sagzy sagzy removed the migration [pull request] Includes migration for review label Jun 25, 2026
@TryGhost TryGhost deleted a comment from github-actions Bot Jun 25, 2026
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.

2 participants