Skip to content

Commit 9b33960

Browse files
authored
feat: support enriched-markdown 0.6.0 (#16)
* feat: support enriched-markdown 0.6 * chore: updat enriched-markdown version
1 parent 46b961e commit 9b33960

7 files changed

Lines changed: 29 additions & 25 deletions

File tree

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ It processes raw, incomplete markdown (as it streams token-by-token from an LLM)
1010

1111
- Renders incomplete streaming markdown correctly — no visual glitches mid-stream
1212
- Background thread processing via `react-native-worklets` Bundle Mode
13-
- Inline LaTeX support (`$...$`) with streaming completion — applied automatically, no configuration needed
14-
- CommonMark rendering (headers, bold, italic, inline code, fenced code blocks, links, images) powered by `react-native-enriched-markdown` with built-in `streamingAnimation`
13+
- LaTeX support with streaming completion — applied automatically, no configuration needed
14+
- CommonMark and GitHub Flavored Markdown rendering powered by `react-native-enriched-markdown` with built-in `streamingAnimation`
1515
- Customizable via `remendConfig`
1616

1717
---
@@ -30,10 +30,13 @@ yarn add react-native-enriched-markdown react-native-worklets remend
3030

3131
| Package | Version |
3232
| -------------------------------- | ------- |
33-
| `react-native-enriched-markdown` | `0.4.0` |
33+
| `react-native-enriched-markdown` | `>=0.4.0` |
3434
| `react-native-worklets` | `0.8.3` |
3535
| `remend` | `1.3.0` |
3636

37+
> [!NOTE]
38+
> GFM table streaming requires `react-native-enriched-markdown >=0.6.0`.
39+
3740
---
3841

3942
## Required setup — Bundle Mode
@@ -171,12 +174,14 @@ import { StreamdownText } from 'react-native-streamdown';
171174

172175
### Props
173176

174-
`StreamdownText` accepts all props from `EnrichedMarkdownText` (except `flavor`, which is hardcoded to `commonmark`) plus one additional prop:
177+
`StreamdownText` accepts all props from `EnrichedMarkdownText` plus one additional prop:
175178

176179
| Prop | Type | Description |
177180
| -------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
178181
| `remendConfig` | `RemendOptions` | Optional. Override the default remend processing config. See [remend docs](https://www.npmjs.com/package/remend) for all available options. |
179182

183+
Pass `flavor="github"` to render GitHub Flavored Markdown. GFM table streaming requires `react-native-enriched-markdown >=0.6.0`.
184+
180185
---
181186

182187
## Example app
@@ -190,12 +195,6 @@ It is a practical reference for the full Bundle Mode setup (Babel, Metro, `packa
190195

191196
---
192197

193-
## Limitations
194-
195-
- **CommonMark only**`StreamdownText` currently renders using the `commonmark` flavour of `react-native-enriched-markdown`. GitHub Flavored Markdown (GFM) support is planned for a future release.
196-
197-
---
198-
199198
Built by [Software Mansion](https://swmansion.com/).
200199

201200
[<img width="128" height="69" alt="Software Mansion Logo" src="https://github.com/user-attachments/assets/f0e18471-a7aa-4e80-86ac-87686a86fe56" />](https://swmansion.com/)

example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1857,7 +1857,7 @@ PODS:
18571857
- React-utils (= 0.85.3)
18581858
- ReactNativeDependencies
18591859
- ReactNativeDependencies (0.85.3)
1860-
- ReactNativeEnrichedMarkdown (0.4.0):
1860+
- ReactNativeEnrichedMarkdown (0.6.0):
18611861
- hermes-engine
18621862
- iosMath (~> 0.9)
18631863
- RCTRequired
@@ -2270,7 +2270,7 @@ SPEC CHECKSUMS:
22702270
ReactCodegen: c8f81e6c6f762dcf442a6203a1fb58f7dafc8014
22712271
ReactCommon: 7dfc3250793bf36cf221096ff59e1179e13eef7f
22722272
ReactNativeDependencies: 9ce75df098e6192b99f48ac8b78f365f02e52fdc
2273-
ReactNativeEnrichedMarkdown: d96de50b3f1207d157fe7e43bf7cdb61db014fb0
2273+
ReactNativeEnrichedMarkdown: 861d6937d7f4a6481e8446538dc715c93b545143
22742274
RNWorklets: 4931990f73bc8f347586918b2e13f11dfadf3b75
22752275
Yoga: 77dfa8673de2874e1855002ae59c68b8be9b007b
22762276

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dependencies": {
1313
"react": "19.2.3",
1414
"react-native": "0.85.3",
15-
"react-native-enriched-markdown": "0.4.0",
15+
"react-native-enriched-markdown": "0.6.0",
1616
"react-native-safe-area-context": "^5.7.0",
1717
"react-native-streamdown": "*",
1818
"react-native-worklets": "0.8.3",

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"react": "19.2.3",
8181
"react-native": "^0.85.3",
8282
"react-native-builder-bob": "^0.40.18",
83-
"react-native-enriched-markdown": "0.4.0",
83+
"react-native-enriched-markdown": "0.6.0",
8484
"react-native-sse": "1.2.1",
8585
"react-native-worklets": "0.8.3",
8686
"release-it": "^19.0.4",
@@ -91,7 +91,7 @@
9191
"peerDependencies": {
9292
"react": "*",
9393
"react-native": "*",
94-
"react-native-enriched-markdown": "0.4.0",
94+
"react-native-enriched-markdown": ">=0.4.0",
9595
"react-native-worklets": ">=0.8.3",
9696
"remend": "1.3.0"
9797
},

src/StreamdownText.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export function StreamdownText({
2020

2121
return (
2222
<EnrichedMarkdownText
23-
flavor="commonmark"
2423
markdown={processedMarkdown}
2524
streamingAnimation
2625
selectable={!isStreaming && selectable}

src/types.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import type { EnrichedMarkdownTextProps } from 'react-native-enriched-markdown';
22
import type { RemendOptions } from 'remend';
33

4-
export interface StreamdownTextProps
5-
extends Omit<EnrichedMarkdownTextProps, 'flavor'> {
4+
export interface StreamdownTextProps extends EnrichedMarkdownTextProps {
65
/**
76
* Optional custom remend configuration.
87
*/

yarn.lock

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10217,13 +10217,20 @@ __metadata:
1021710217
languageName: node
1021810218
linkType: hard
1021910219

10220-
"react-native-enriched-markdown@npm:0.4.0":
10221-
version: 0.4.0
10222-
resolution: "react-native-enriched-markdown@npm:0.4.0"
10220+
"react-native-enriched-markdown@npm:0.6.0":
10221+
version: 0.6.0
10222+
resolution: "react-native-enriched-markdown@npm:0.6.0"
1022310223
peerDependencies:
10224+
"@expo/config-plugins": ">=50.0.0"
10225+
katex: ">=0.16.0"
1022410226
react: "*"
1022510227
react-native: "*"
10226-
checksum: 10c0/4e4fb31146bbcac32e693d3a7408af1f61456c5b6dd4fed6df841f4b8148ca223610f4e7221f8f2c73f7d3a91af7398f3e8ad37c157862f680d52d7c22d614c2
10228+
peerDependenciesMeta:
10229+
"@expo/config-plugins":
10230+
optional: true
10231+
katex:
10232+
optional: true
10233+
checksum: 10c0/9d71d6c44bd317b3d575ac4a4d1501ee55f280da090a7660813b3d86d23f67fcce4e2f016fd9cc2ef0c567f47807d4a065af60dfd3278c05e5f81423480f521c
1022710234
languageName: node
1022810235
linkType: hard
1022910236

@@ -10271,7 +10278,7 @@ __metadata:
1027110278
react: "npm:19.2.3"
1027210279
react-native: "npm:0.85.3"
1027310280
react-native-builder-bob: "npm:^0.40.18"
10274-
react-native-enriched-markdown: "npm:0.4.0"
10281+
react-native-enriched-markdown: "npm:0.6.0"
1027510282
react-native-monorepo-config: "npm:^0.3.3"
1027610283
react-native-safe-area-context: "npm:^5.7.0"
1027710284
react-native-streamdown: "npm:*"
@@ -10305,7 +10312,7 @@ __metadata:
1030510312
react: "npm:19.2.3"
1030610313
react-native: "npm:^0.85.3"
1030710314
react-native-builder-bob: "npm:^0.40.18"
10308-
react-native-enriched-markdown: "npm:0.4.0"
10315+
react-native-enriched-markdown: "npm:0.6.0"
1030910316
react-native-sse: "npm:1.2.1"
1031010317
react-native-worklets: "npm:0.8.3"
1031110318
release-it: "npm:^19.0.4"
@@ -10315,7 +10322,7 @@ __metadata:
1031510322
peerDependencies:
1031610323
react: "*"
1031710324
react-native: "*"
10318-
react-native-enriched-markdown: 0.4.0
10325+
react-native-enriched-markdown: ">=0.4.0"
1031910326
react-native-worklets: ">=0.8.3"
1032010327
remend: 1.3.0
1032110328
languageName: unknown

0 commit comments

Comments
 (0)