Skip to content

Migrate off retired earmark markdown dependency#4886

Draft
midigofrank wants to merge 1 commit into
mainfrom
4878-remove-earmark
Draft

Migrate off retired earmark markdown dependency#4886
midigofrank wants to merge 1 commit into
mainfrom
4878-remove-earmark

Conversation

@midigofrank

Copy link
Copy Markdown
Collaborator

Description

Replace the direct earmark dependency with mdex for rendering AI assistant message content. earmark is retired and unmaintained; mix hex.audit flags it.

mdex node structs cannot hold arbitrary HTML attributes, so per-element Tailwind classes are now injected into the rendered HTML instead of via AST manipulation. Raw HTML passthrough and the raw-content fallback are preserved, and the language- prefix on code blocks is stripped to keep earmark's previous output.

Closes #4878

Validation steps

  1. (How can a reviewer validate your work?)

Additional notes for the reviewer

  1. (Is there anything else the reviewer should know or look out for?)

AI Usage

Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):

  • I have used Claude Code
  • I have used another model
  • I have not used AI

You can read more details in our
Responsible AI Policy

Pre-submission checklist

  • I have performed an AI review of my code (we recommend using /review
    with Claude Code)
  • I have implemented and tested all related authorization policies.
    (e.g., :owner, :admin, :editor, :viewer)
  • I have updated the changelog.
  • I have ticked a box in "AI usage" in this PR

Replace the direct earmark dependency with mdex for rendering AI
assistant message content. earmark is retired and unmaintained;
mix hex.audit flags it.

mdex node structs cannot hold arbitrary HTML attributes, so per-element
Tailwind classes are now injected into the rendered HTML instead of via
AST manipulation. Raw HTML passthrough and the raw-content fallback are
preserved, and the language- prefix on code blocks is stripped to keep
earmark's previous output.

earmark remains a dev-only transitive dependency of phoenix_storybook
0.9.2 until that is upgraded to 1.2+ (which requires Phoenix 1.8).
@github-project-automation github-project-automation Bot moved this to New Issues in Core Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New Issues

Development

Successfully merging this pull request may close these issues.

Migrate off retired earmark markdown dependency

1 participant