Add backend MFM support #7889

Merged
lambadalambda merged 3 commits from lambadalambda/pleroma:mfm-backend into develop 2026-05-11 13:30:04 +00:00

Summary

  • Adds backend support for text/x.misskeymarkdown posts using a pinned mfm_parser dependency.
  • Emits ActivityPub source.mediaType and htmlMfm, plus the FEP-c16b JSON-LD context entry.
  • Renders incoming Misskey/Akkoma MFM from source.content and legacy _misskey_content, while scrubbing trusted-html htmlMfm payloads instead of reparsing them.
  • Adds a strict sanitizer allowlist for MFM span classes/data attributes and regression tests for local and federated behavior.
  • Related to #2774, which discusses MFM animation handling/policy.

Verification

  • Docker formatting checks passed.
  • Docker targeted tests passed: mix test test/pleroma/web/common_api_test.exs test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs test/pleroma/web/activity_pub/utils_test.exs test/mix/tasks/pleroma/config_test.exs
  • Latest targeted run: 213 tests, 0 failures.

Notes

  • The MFM parser dependency is pinned to 360a30267a847810a63ab48f606ba227b2ca05f0.
  • Parser failures fall back to sanitized markdown output; remote MFM source is size-limited before parsing/persisting.
## Summary - Adds backend support for `text/x.misskeymarkdown` posts using a pinned `mfm_parser` dependency. - Emits ActivityPub `source.mediaType` and `htmlMfm`, plus the FEP-c16b JSON-LD context entry. - Renders incoming Misskey/Akkoma MFM from `source.content` and legacy `_misskey_content`, while scrubbing trusted-html `htmlMfm` payloads instead of reparsing them. - Adds a strict sanitizer allowlist for MFM span classes/data attributes and regression tests for local and federated behavior. ## Related - Related to #2774, which discusses MFM animation handling/policy. ## Verification - Docker formatting checks passed. - Docker targeted tests passed: `mix test test/pleroma/web/common_api_test.exs test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs test/pleroma/web/activity_pub/utils_test.exs test/mix/tasks/pleroma/config_test.exs` - Latest targeted run: 213 tests, 0 failures. ## Notes - The MFM parser dependency is pinned to `360a30267a847810a63ab48f606ba227b2ca05f0`. - Parser failures fall back to sanitized markdown output; remote MFM source is size-limited before parsing/persisting.
Add backend MFM support
Some checks failed
ci/woodpecker/pr/changelog Pipeline failed
ci/woodpecker/pr/lint Pipeline failed
ci/woodpecker/pr/unit-testing-elixir-1.15 unknown status
ci/woodpecker/pr/unit-testing-elixir-1.18 unknown status
6b86e31e5d
Add changelog for MFM support
Some checks failed
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline failed
ci/woodpecker/pr/unit-testing-elixir-1.18 unknown status
ci/woodpecker/pr/unit-testing-elixir-1.15 unknown status
c780298ce7
Owner

Thank you!

Thank you!
Fix MFM validator alias ordering
All checks were successful
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.15 Pipeline was successful
ci/woodpecker/pr/unit-testing-elixir-1.18 Pipeline was successful
47021b5aba
lambadalambda changed title from WIP: Add backend MFM support to Add backend MFM support 2026-05-11 13:27:21 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pleroma/pleroma!7889
No description provided.