enriched-markdown-android is an open-source Markdown renderer for Jetpack Compose. Parsing is md4c over JNI, rendering is native Android text, so you get platform selection handles, copy and TalkBack for free.

What's new in 0.3.0:

  • Spoilers - ||text|| is drawn transparent and concealed by an animated particle overlay on the text view's canvas, tap to reveal. You can plug in your own overlay with a draw callback per concealed slice.
  • LaTeX math – $inline$ and $$block$$, wide equations scroll sideways, long-press to copy.
  • Syntax highlighting – fenced code colored by tree-sitter, 14 grammars, every token type themeable.
  • Better code blocks – language header, copy button, long lines scroll instead of wrapping.
  • Highlight – ==text== with `Flags(highlight = true)`.
  • Optional plugins – math and highlighting are separate artifacts, so you only add what you need.
  • Native Selection – Standard Android text selection handles and native copy behavior.

💎 Available on Maven Central:

dependencies { implementation("com.swmansion.enriched.markdown:compose:0.3.0") implementation("com.swmansion.enriched.markdown:math:0.3.0") // optional implementation("com.swmansion.enriched.markdown:code-highlight:0.3.0") // optional } 

Quick Usage:

MarkdownPlugins(LatexMathPlugin, CodeHighlightPlugin) { EnrichedMarkdownText( markdown = content, flags = Flags(highlight = true), onLinkClick = { url -> openUrl(url) }, ) } 

GitHub & Docs:
https://github.com/software-mansion/enriched-markdown/blob/main/packages/enriched-markdown-android/README.md

submitted by /u/Sea-Arm9235
[link] [comments]