iOS 与 Android 原生 SDK 需分别通过 Swift Package Manager 和 Maven Central 单独引入;LaTeX 渲染依赖第三方 RaTeX,代码高亮依赖 tree-sitter,需确认对应平台集成;各平台功能支持范围不一致,需对照官方兼容性表格确认。
enriched-markdown
software-mansionMIT活跃维护跨平台富文本编辑方案,用 Markdown 语法在 React Native 等平台上实现带格式的文本输入与渲染,省去自建富文本编辑器的麻烦。
Multiplatform Markdown-Based Rich Text Solution
yarn add react-native-enriched-markdownREADME 未说明硬件要求,仅说明支持 iOS、Android、macOS 与 Web 平台。
用原生文本 API 渲染和编辑 Markdown 的跨平台 SDK,替代 WebView 方案
跨平台富文本编辑方案,用 Markdown 语法在 React Native 等平台上实现带格式的文本输入与渲染,省去自建富文本编辑器的麻烦。
核心能力
- 基于平台原生文本 API 渲染 Markdown,不走 WebView
- 支持富文本输入并输出 Markdown,含标题、列表、链接、提及
- 完整支持 CommonMark 与 GFM 扩展(表格、任务列表、删除线)
- 支持 Markdown 流式渲染,适配 AI/LLM 聊天界面
- 用 tree-sitter 做原生代码语法高亮,并支持 LaTeX 数学公式
容易踩的坑
- v1.1.1最新正式版2026-10-06 · 2026-10-06 10:18 UTC
What's Changed
Fixes & Improvements
- fix(input): ensure taps on rich text input don't trigger parent onPress by @hsource in #884
- fix(ios): give each list item's marker array its own hash by @voska in #913
- fix(ios): pass accessibility labels into GFM blockquote children by @huytdps13400 in #919
- fix(ios): account for baseline offset when drawing underline and strikethrough by @hryhoriiK97 in #916
- fix(ios): make attributed text explicitly set NSOriginalFont by @eszlamczyk in #929
Full Changelog: https://github.com/software-mansion/enriched-markdown/compare/v1.1.0...main
- v1.1.02026-10-01 · 2026-10-01 11:28 UTC
查看更新说明
What's Changed
New Features
- feat: add enableTaskListItemToggle prop to EnrichedMarkdownText by @CodingItWrong in #651
- feat: allow opting out of tree-sitter & RaTeX downloads via package.json by @eszlamczyk in #661
- feat: link dependencies based on package.json config by @hryhoriiK97 in #673
- feat(jest): support onLinkPress, onLinkLongPress, and onTaskListItemPress in mock by @hryhoriiK97 in #712
- feat: allow disabling block context menus by @huytdps13400 in #708
- feat: onImagePress callback by @eszlamczyk in #710
- feat: add preserveBlankLines md4c flag by @eszlamczyk in #726
- feat: gfm blockquotes (#608) by @eszlamczyk in #674
- feat: gfm blockquote admonitions by @eszlamczyk in #692
- feat: add block-level context menu (Copy / Copy as Markdown) to blockquote and admonition containers by @hryhoriiK97 in #763
- feat(ios): make enter not repaint text above the caret by @eszlamczyk in #742
- feat: onCodePress prop by @eszlamczyk in #746
- feat: include applybaseline offset for every block element by @eszlamczyk in #785
- feat: onLatexError callback by @eszlamczyk in #775
- feat: add numberOfLines and ellipsizeMode for CommonMark by @eszlamczyk in #788
- feat: add native video playback support by @hryhoriiK97 in #765
- feat: add macOS video playback support by @hryhoriiK97 in #811
- feat(input): convert typed markdown block prefixes into blocks (markdownShortcuts) by @cvburgess in #783
- feat: support fontFamily in linkVariants by @juliusmarminge in #861
- feat(ios): give custom spoiler overlays the text's baseline and segment order by @hryhoriiK97 in #894
Fixes & Improvements
- fix: stop overwriting package README during npm publish by @hryhoriiK97 in #669
- fix: link README package table to per-package READMEs by @hryhoriiK97 in [#675](https://github.com/software-mansion/enriched-markdown/pull
- v1.0.22026-08-20 · 2026-08-20 12:31 UTC
查看更新说明
What's Changed
Breaking Changes
The Expo config plugin was removed
The built-in Expo config plugin (
app.plugin.jsand theplugin/folder) has been removed. Feature configuration now lives entirely in your app'spackage.json, read directly by the native build and bypostinstall- the same approachreact-native-workletsuses for its static feature flags.Feature config moved to
package.json; ENV vars and gradle properties are deprecatedThe
enriched-markdownblock in your app'spackage.jsonis now the single source of truth forenableMath,enableCodeHighlight, andcodeHighlightLanguageson both platforms - the native build reads it directly atpod install/ Gradle configuration time. The previous build flags still work as a fallback but are deprecatedTo see full breaking changes logs see documentation
New Features
- feat: link dependencies based on package.json config by @hryhoriiK97 in #673
Fixes & Improvements
- fix: stop overwriting package README during npm publish by @hryhoriiK97 in #669
- fix: link README package table to per-package READMEs by @hryhoriiK97 in #675
- fix(docs): update feature comparison link to anchor directly to compatibility section by @hryhoriiK97 in #683
- fix(android): expo windows developement build by @eszlamczyk in #688
- fix(android): honor allowFontScaling in EnrichedMarkdownText measure by @hryhoriiK97 in #684
- fix: key code-highlight registry per app for monorepo safety by @eszlamczyk in #680
Docs & Chores
- chore: update repository references and project name to 'enriched-markdown' by @hryhoriiK97 in #667
- chore: update npm package description by @hryhoriiK97 in #670
- chore: add dark mode support for root README hero image by @hryhoriiK97 in #672
- chore: fix light mode image in root README by @hryhoriiK97 in #676
- chore: update README image in react-native-enriched-markdown by @hryhoriiK97 in #677
- chore: update README image in ios-enrichd-markdown by @hryhoriiK97 in #678
- chore: update README image in android-enriched-markdown by @hryhoriiK97 in #679
Full Changelog: https://github.com/software-mansion/enriched-markdown/compare/v1.0.1...main
- v1.0.12026-08-13 · 2026-08-13 13:20 UTC
查看更新说明
What's Changed
New Features
- feat: allow opting out of tree-sitter & RaTeX downloads via package.json by @eszlamczyk in #661
Refactors
- refactor: download vendored assets at postinstall to reduce package size by @hryhoriiK97 in #660
Full Changelog: https://github.com/software-mansion/react-native-enriched-markdown/compare/v1.0.0...main
- v1.0.02026-08-13 · 2026-08-13 09:53 UTC
查看更新说明
What's Changed
New Features
- feat(input): block-editing pipeline foundation by @wildseansy in #460
- feat(input): heading blocks (H1-H6) on the block pipeline by @wildseansy in #497
- feat(input): import block ranges on paste by @wildseansy in #498
- feat(input): heading toolbar support — toggleHeading command, active-state, empty-line persistence by @wildseansy in #499
- feat(ios): render in-paragraph display math instead of dropping its delimiters by @EthanCai9568 in #537
- feat(ios): voiceover read contents of input element by @eszlamczyk in #526
- feat: add horizontalOverflow style prop for edge-to-edge scrollable tables by @hryhoriiK97 in #542
- feat: custom image request headers by @eszlamczyk in #544
- feat: add maxHeight, aspectRatio and resizeMode to block image styling by @eszlamczyk in #539
- feat: space between list items by @eszlamczyk in #578
- feat: support saving original image by @eszlamczyk in #548
- feat: centering of entire tables by @eszlamczyk in #554
- feat(input): rebased version of "list state, toolbar, docs, and e2e (lists 5/5)" by @hsource in #545
- feat: support loading local images by @eszlamczyk in #588
- feat: on key press support by @eszlamczyk in #584
- feat: match rn textinput keyboard-dismiss behavior on taps outside the input by @eszlamczyk in #597
- feat(ios): port parser module to ios by @graszka22 in #556
- feat(ios): add markdown theme system by @graszka22 in #557
- feat(ios): add AST-to-attributed-string renderer by @graszka22 in #558
- feat(ios): add EnrichedMarkdownText SwiftUI view by @graszka22 in #559
- feat(ios): add async parse and render for EnrichedMarkdownText by @graszka22 in [#560](https://github.com/software-mansion/re
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
A multi-platform SDK for rendering Markdown as native text and editing rich text with Markdown output. Ships as a React Native library with iOS, Android, macOS, and Web support, plus standalone native SDKs for iOS (Swift) and Android (Kotlin).
Features
- Native text rendering — High-performance Markdown rendering built on platform text APIs (no WebView)
- Rich text input — Text input with Markdown output, inline formatting, headings, lists, links, and mentions
- Cross-platform — Consistent API across React Native (TypeScript), iOS (Swift), and Android (Kotlin)
- CommonMark & GFM — Full CommonMark compliance with GitHub Flavored Markdown extensions (tables, task lists, strikethrough)
- LaTeX math — Block and inline math rendering powered by RaTeX
- Markdown streaming — Real-time streaming support for AI/LLM chat interfaces
- Code syntax highlighting — Native syntax highlighting powered by tree-sitter
- Accessibility — VoiceOver on iOS, TalkBack on Android, semantic HTML on web
See the feature comparison table for a detailed breakdown of supported features per platform.
Packages
| Platform | Package | README |
|---|---|---|
| React Native | React Native | |
| Android | Android | |
| iOS | iOS |
Quick start
React Native
yarn add react-native-enriched-markdown
import { EnrichedMarkdownText } from 'react-native-enriched-markdown';
import { Linking } from 'react-native';
<EnrichedMarkdownText
markdown={"# Hello\n\nThis is **enriched** [markdown](https://commonmark.org)."}
onLinkPress={({ url }) => Linking.openURL(url)}
/>
Android
dependencies {
implementation("com.swmansion.enriched.markdown:compose:0.3.0")
}
import com.swmansion.enriched.markdown.compose.EnrichedMarkdownText
EnrichedMarkdownText(
markdown = "# Hello\n\nThis is **enriched** [markdown](https://commonmark.org).",
onLinkClick = { url -> /* open url */ },
)
iOS
dependencies: [
.package(
url: "https://github.com/software-mansion-labs/enriched-markdown-ios.git",
from: "0.1.0"
),
]
import EnrichedMarkdown
import SwiftUI
EnrichedMarkdownText("# Hello\n\nThis is **enriched** [markdown](https://commonmark.org).")
.environment(\.openURL, OpenURLAction { url in
UIApplication.shared.open(url)
return .handled
})
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
Enriched Markdown is licensed under The MIT License.
Built by Software Mansion.