enriched-markdown

software-mansionMIT活跃维护

跨平台富文本编辑方案,用 Markdown 语法在 React Native 等平台上实现带格式的文本输入与渲染,省去自建富文本编辑器的麻烦。

Multiplatform Markdown-Based Rich Text Solution

v1.1.1发布于 2026-10-06 10:18 UTC1,358star +4 / 7 天139fork同步于 2026-11-10 11:48 UTC

怎么上手

由 README 提炼,执行前请确认
yarn add react-native-enriched-markdown
硬件要求按 README 说明

README 未说明硬件要求,仅说明支持 iOS、Android、macOS 与 Web 平台。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用原生文本 API 渲染和编辑 Markdown 的跨平台 SDK,替代 WebView 方案

跨平台富文本编辑方案,用 Markdown 语法在 React Native 等平台上实现带格式的文本输入与渲染,省去自建富文本编辑器的麻烦。

核心能力

  • 基于平台原生文本 API 渲染 Markdown,不走 WebView
  • 支持富文本输入并输出 Markdown,含标题、列表、链接、提及
  • 完整支持 CommonMark 与 GFM 扩展(表格、任务列表、删除线)
  • 支持 Markdown 流式渲染,适配 AI/LLM 聊天界面
  • 用 tree-sitter 做原生代码语法高亮,并支持 LaTeX 数学公式

容易踩的坑

iOS 与 Android 原生 SDK 需分别通过 Swift Package Manager 和 Maven Central 单独引入;LaTeX 渲染依赖第三方 RaTeX,代码高亮依赖 tree-sitter,需确认对应平台集成;各平台功能支持范围不一致,需对照官方兼容性表格确认。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v1.1.1
  1. 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

  2. v1.1.02026-10-01 · 2026-10-01 11:28 UTC
    查看更新说明

    What's Changed

    New Features

    Fixes & Improvements

  3. 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.js and the plugin/ folder) has been removed. Feature configuration now lives entirely in your app's package.json, read directly by the native build and by postinstall - the same approach react-native-worklets uses for its static feature flags.

    Feature config moved to package.json; ENV vars and gradle properties are deprecated

    The enriched-markdown block in your app's package.json is now the single source of truth for enableMath, enableCodeHighlight, and codeHighlightLanguages on both platforms - the native build reads it directly at pod install / Gradle configuration time. The previous build flags still work as a fallback but are deprecated

    To see full breaking changes logs see documentation

    New Features

    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

    Full Changelog: https://github.com/software-mansion/enriched-markdown/compare/v1.0.1...main

  4. 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

  5. v1.0.02026-08-13 · 2026-08-13 09:53 UTC
    查看更新说明

    What's Changed

    New Features

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    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

    PlatformPackageREADME
    React NativenpmReact Native
    AndroidMaven CentralAndroid
    iOSswift packageiOS

    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.