The best way to control Claude Code, Codex and more from any computer or phone
chore(mobile): sync Enriched Markdown with upstream 1d00a92a (#32180)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: ahalekelly <7078138+ahalekelly@users.noreply.github.com> Co-authored-by: Tomer Danan <40542472+Dananz@users.noreply.github.com> Co-authored-by: Dan Sanduleac <dan@sanduleac.com> Co-authored-by: Yash Singh <saiansh2525@gmail.com> Co-authored-by: shivam <91240327+shivamhwp@users.noreply.github.com>
Julius Marminge committed
Nov 8, 2026 at 18:08 UTC
986a4f56a80963cc139dbc581665b40411855659
8 files changed
+39
-109
.pnpmfile.cjs
+27
-2
@@ -1,8 +1,33 @@
1
-// Windows installs need Linux x64 glibc binaries because WSL shares node_modules.
2
-// Keep other platforms native; release scripts set their own architectures.
1
+const fs = require("node:fs");
2
+const path = require("node:path");
3
+
4
+// Our forks ship as tarballs in apps/mobile/deps. A pnpm patch on one is a second source of
5
+// truth that the next tarball silently drops, so changes go to the fork (apps/mobile/deps/README.md).
6
+function forkTarballPatches(patchedDependencies) {
7
+ const manifestPath = path.join(__dirname, "apps/mobile/package.json");
8
+ // Release staging installs a partial workspace without the mobile app.
9
+ if (!patchedDependencies || !fs.existsSync(manifestPath)) return [];
10
+ const { dependencies = {} } = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
11
+ const forks = Object.keys(dependencies).filter((name) =>
12
+ String(dependencies[name]).startsWith("file:deps/"),
13
+ );
14
+ return Object.keys(patchedDependencies).filter((key) =>
15
+ forks.some((name) => key === name || key.startsWith(`${name}@`)),
16
+ );
17
+}
18
+
19
module.exports = {
20
hooks: {
21
updateConfig(config) {
22
+ const forkPatches = forkTarballPatches(config.patchedDependencies);
23
+ if (forkPatches.length > 0) {
24
+ throw new Error(
25
+ `pnpm-workspace.yaml patches ${forkPatches.join(", ")}, which ships as a fork tarball in ` +
26
+ "apps/mobile/deps. Change the fork and replace the tarball instead (apps/mobile/deps/README.md).",
27
+ );
28
+ }
29
+ // Windows installs need Linux x64 glibc binaries because WSL shares node_modules.
30
+ // Keep other platforms native; release scripts set their own architectures.
31
// oxlint-disable-next-line t3code/no-global-process-runtime -- pnpm loads this file before any Effect runtime exists.
32
if (process.platform !== "win32") return config;
33
return {
apps/mobile/deps/README.md
+3
-3
@@ -1,5 +1,5 @@
1
-The Enriched Markdown tarball comes from Julius's [`fork/t3-mobile` branch](https://github.com/pingdotgg/enriched-markdown/tree/fork/t3-mobile). Its `t3-fork.json` records the exact source commit and upstream base. React block renderers and signed image sources (`renderers`, `resolveImageSource`) are upstream. The fork carries native streaming memory bounds (an 8 MiB measurement-key budget and coalesced pending renders), plus changes with an open upstream PR: the `onLinksChange` link list that link pills and iOS link menus read ([#1088](https://github.com/software-mansion/enriched-markdown/pull/1088)), Android inline image alignment ([#1089](https://github.com/software-mansion/enriched-markdown/pull/1089)), clipboard link metadata ([#962](https://github.com/software-mansion/enriched-markdown/pull/962)), development-host autolinks ([#961](https://github.com/software-mansion/enriched-markdown/pull/961)), and `md4cFlags.preserveWindowsPaths`, which keeps backslashes in Windows drive paths in prose ([#1105](https://github.com/software-mansion/enriched-markdown/pull/1105), after [md4c#5](https://github.com/software-mansion-labs/md4c/pull/5)).
1
+The Enriched Markdown tarball comes from Julius's [`fork/t3-mobile` branch](https://github.com/pingdotgg/enriched-markdown/tree/fork/t3-mobile). Its `t3-fork.json` records the exact source commit and upstream base. React block renderers, signed image sources, the `onLinksChange` link list (`renderers`, `resolveImageSource`, `onLinksChange`) and the iOS streaming memory bounds are upstream. The fork carries only changes with an open upstream PR: clipboard link metadata ([#962](https://github.com/software-mansion/enriched-markdown/pull/962)), development-host autolinks ([#961](https://github.com/software-mansion/enriched-markdown/pull/961)) and hash-route link fragments ([mity/md4c#454](https://github.com/mity/md4c/pull/454), arriving through [md4c#7](https://github.com/software-mansion-labs/md4c/pull/7)), `md4cFlags.preserveWindowsPaths`, which keeps backslashes in Windows drive paths in prose ([#1105](https://github.com/software-mansion/enriched-markdown/pull/1105), after [mity/md4c#477](https://github.com/mity/md4c/pull/477)), GitHub's strikethrough rules for `~` ([md4c#6](https://github.com/software-mansion-labs/md4c/pull/6)), `\(…\)` and `\[…\]` math delimiters ([#1043](https://github.com/software-mansion/enriched-markdown/pull/1043), [md4c#4](https://github.com/software-mansion-labs/md4c/pull/4)), iOS Copy as Markdown keeping bold spans whole ([#1143](https://github.com/software-mansion/enriched-markdown/pull/1143)), and line breaks in copied table cells written as `<br>` ([#1144](https://github.com/software-mansion/enriched-markdown/pull/1144)).
2
3
-To replace it, commit the fork changes, run `yarn install --immutable` and `yarn workspace react-native-enriched-markdown prepare` in the fork checkout, then `node scripts/pack-t3.mjs /path/to/t3code/apps/mobile/deps`. Keep the package version aligned with Julius's `fork/t3-mobile` branch. Rename the archive to include the first eight characters of the source commit, such as `react-native-enriched-markdown-1.2.0-t3.16-8d2f84a8.tgz`, so each build has a distinct dependency path without version bumps. Update the tarball path in `apps/mobile/package.json` and `pnpm-workspace.yaml`'s `allowBuilds`, and run `vp i` to update the lockfile. Native clients need rebuilding when this dependency changes.
3
+To replace it, commit the fork changes, run `yarn install --immutable` and `yarn workspace react-native-enriched-markdown prepare` in the fork checkout, then `node scripts/pack-t3.mjs /path/to/t3code/apps/mobile/deps`. Keep the package version aligned with Julius's `fork/t3-mobile` branch. Rename the archive to include the first eight characters of the source commit, such as `react-native-enriched-markdown-1.2.0-t3.18-4287c5d3.tgz`, so each build has a distinct dependency path without version bumps. Update the tarball path in `apps/mobile/package.json` and `pnpm-workspace.yaml`'s `allowBuilds`, and run `vp i` to update the lockfile. Native clients need rebuilding when this dependency changes.
4
5
-`patches/react-native-enriched-markdown@1.2.0-t3.16.patch` writes a newline inside a copied table cell as `<br>`, so Copy as Markdown keeps the row whole. It is not in the fork yet; fold it into `fork/t3-mobile` or drop it when you replace the tarball, since pnpm applies it to any archive with the same version.
5
+Change a tarball in this directory through its fork, never with a pnpm patch: `.pnpmfile.cjs` fails the install when `patchedDependencies` names one, since the next tarball would drop the patch without a trace.
apps/mobile/deps/react-native-enriched-markdown-1.2.0-t3.16-29ddd424.tgz
Binary files a/apps/mobile/deps/react-native-enriched-markdown-1.2.0-t3.16-29ddd424.tgz and /dev/null differ
apps/mobile/deps/react-native-enriched-markdown-1.2.0-t3.18-4287c5d3.tgz
Binary files /dev/null and b/apps/mobile/deps/react-native-enriched-markdown-1.2.0-t3.18-4287c5d3.tgz differ
apps/mobile/package.json
+1
-1
@@ -122,7 +122,7 @@
122
"react-dom": "catalog:",
123
"react-native": "0.88.0",
124
"react-native-blob-util": "0.25.1",
125
- "react-native-enriched-markdown": "file:deps/react-native-enriched-markdown-1.2.0-t3.16-29ddd424.tgz",
125
+ "react-native-enriched-markdown": "file:deps/react-native-enriched-markdown-1.2.0-t3.18-4287c5d3.tgz",
126
"react-native-gesture-handler": "~3.3.0",
127
"react-native-image-viewing": "^0.2.2",
128
"react-native-keyboard-controller": "1.22.8",
patches/react-native-enriched-markdown@1.2.0-t3.16.patch
deleted
-92
@@ -1,92 +0,0 @@
1
-diff --git a/android/src/main/java/com/swmansion/enriched/markdown/segments/TableContainerView.kt b/android/src/main/java/com/swmansion/enriched/markdown/segments/TableContainerView.kt
2
---- a/android/src/main/java/com/swmansion/enriched/markdown/segments/TableContainerView.kt
3
-+++ b/android/src/main/java/com/swmansion/enriched/markdown/segments/TableContainerView.kt
4
-@@ -131,7 +131,7 @@ class TableContainerView(
5
- TableCellData(
6
- attributedText = renderCellNode(cell, isHeader, align),
7
- plainText = extractPlainText(cell),
8
-- markdownText = MarkdownASTSerializer.serializeChildren(cell),
9
-+ markdownText = MarkdownASTSerializer.serializeTableCell(cell),
10
- isHeader = isHeader,
11
- alignment = align,
12
- )
13
-diff --git a/android/src/main/java/com/swmansion/enriched/markdown/utils/common/serialization/MarkdownASTSerializer.kt b/android/src/main/java/com/swmansion/enriched/markdown/utils/common/serialization/MarkdownASTSerializer.kt
14
---- a/android/src/main/java/com/swmansion/enriched/markdown/utils/common/serialization/MarkdownASTSerializer.kt
15
-+++ b/android/src/main/java/com/swmansion/enriched/markdown/utils/common/serialization/MarkdownASTSerializer.kt
16
-@@ -20,6 +20,12 @@ object MarkdownASTSerializer {
17
- return buffer.toString()
18
- }
19
-
20
-+ private val tableCellLineBreak = Regex("""(?<!\\)(\\*)\n""")
21
-+
22
-+ /** Serializes a table cell's content; a newline inside it becomes `<br>` so the row stays on one line. */
23
-+ fun serializeTableCell(cell: MarkdownASTNode): String =
24
-+ serializeChildren(cell).replace(tableCellLineBreak, "$1$1<br>")
25
-+
26
- /**
27
- * Serializes a Blockquote or Admonition node back to markdown, including
28
- * the `> ` prefix on every line and `> [!TYPE]` header for admonitions.
29
-@@ -179,7 +185,7 @@ object MarkdownASTSerializer {
30
- for (section in node.children) {
31
- for (row in section.children) {
32
- if (row.type != NodeType.TableRow) continue
33
-- val cells = row.children.map { serializeChildren(it) }
34
-+ val cells = row.children.map { serializeTableCell(it) }
35
- buffer.append("| ")
36
- buffer.append(cells.joinToString(" | "))
37
- buffer.append(" |\n")
38
-diff --git a/ios/segments/TableContainerView.m b/ios/segments/TableContainerView.m
39
---- a/ios/segments/TableContainerView.m
40
-+++ b/ios/segments/TableContainerView.m
41
-@@ -163,7 +163,7 @@ static NSArray<NSArray<TableCellData *> *> *ENRMTableBuildRows(MarkdownASTNode *
42
- cell.isHeader = isSectionHead || (cellNode.type == MarkdownNodeTypeTableHeaderCell);
43
- cell.alignment = ENRMTableTextAlignmentFromString(cellNode.attributes[@"align"]);
44
- cell.plainText = ENRMTablePlainTextFromNode(cellNode);
45
-- cell.markdownText = markdownFromASTNodeChildren(cellNode);
46
-+ cell.markdownText = markdownFromTableCellNode(cellNode);
47
-
48
- StyleConfig *cellConfig = cell.isHeader ? headerCellConfig : bodyCellConfig;
49
- cell.attributedText =
50
-diff --git a/ios/utils/MarkdownASTSerializer.h b/ios/utils/MarkdownASTSerializer.h
51
---- a/ios/utils/MarkdownASTSerializer.h
52
-+++ b/ios/utils/MarkdownASTSerializer.h
53
-@@ -17,6 +17,9 @@ NSString *markdownFromASTNode(MarkdownASTNode *node);
54
- /// Useful for extracting the markdown content of a container node (e.g. a table cell).
55
- NSString *markdownFromASTNodeChildren(MarkdownASTNode *node);
56
-
57
-+/// Serializes a table cell's content; a newline inside it becomes `<br>` so the row stays on one line.
58
-+NSString *markdownFromTableCellNode(MarkdownASTNode *node);
59
-+
60
- /// Serializes a Blockquote or Admonition node to full markdown, including `> ` line
61
- /// prefixes and `> [!TYPE]` header for admonitions.
62
- NSString *markdownFromBlockquoteNode(MarkdownASTNode *node);
63
-diff --git a/ios/utils/MarkdownASTSerializer.m b/ios/utils/MarkdownASTSerializer.m
64
---- a/ios/utils/MarkdownASTSerializer.m
65
-+++ b/ios/utils/MarkdownASTSerializer.m
66
-@@ -148,7 +148,7 @@ static void appendTableMarkdown(MarkdownASTNode *node, NSMutableString *buffer)
67
- continue;
68
- NSMutableArray<NSString *> *cells = [NSMutableArray arrayWithCapacity:row.children.count];
69
- for (MarkdownASTNode *cell in row.children) {
70
-- [cells addObject:markdownFromASTNodeChildren(cell)];
71
-+ [cells addObject:markdownFromTableCellNode(cell)];
72
- }
73
- [buffer appendFormat:@"| %@ |\n", [cells componentsJoinedByString:@" | "]];
74
- if (!headerDone) {
75
-@@ -333,6 +333,17 @@ NSString *markdownFromASTNodeChildren(MarkdownASTNode *node)
76
- return [buffer copy];
77
- }
78
-
79
-+NSString *markdownFromTableCellNode(MarkdownASTNode *node)
80
-+{
81
-+ NSString *markdown = markdownFromASTNodeChildren(node);
82
-+ if (![markdown containsString:@"\n"])
83
-+ return markdown;
84
-+ return [markdown stringByReplacingOccurrencesOfString:@"(?<!\\\\)(\\\\*)\n"
85
-+ withString:@"$1$1<br>"
86
-+ options:NSRegularExpressionSearch
87
-+ range:NSMakeRange(0, markdown.length)];
88
-+}
89
-+
90
- NSString *markdownFromBlockquoteNode(MarkdownASTNode *node)
91
- {
92
- if (!node)
pnpm-lock.yaml
+7
-8
@@ -351,7 +351,7 @@ overrides:
351
352
packageExtensionsChecksum: sha256-EowbsmlBFaoO0Ypufw901RnvdyjKG5dcdk2FRbc7Dr0=
353
354
-pnpmfileChecksum: sha256-HxQwAhyWNI/9fnrZxQ0MltAhBMQohaHvLg4GiiAL6JA=
354
+pnpmfileChecksum: sha256-h8NLkl2dhhbQKbAHnoo4rQ3tYV96igLQxJ7la6dsbSc=
355
356
patchedDependencies:
357
'@alchemy.run/test@2.0.0-beta.85': 29c0539ea71d9cc372f0b16558640599beb9bc609605feb2a493da268d72713e
@@ -382,7 +382,6 @@ patchedDependencies:
382
micromark-extension-llm-math@3.1.0: 4eeb9d9e27ebc75e98795e21c0719005483dad7d233055698257f7d10e91603b
383
micromark@4.0.2: cb79edde7eca83bbcaaafb6ceb7b044b81b987314cde4910823b15257ecada67
384
node-pty@1.2.0-beta.15: f1e680afec85f650699ea756f91f469844ec4c976f4f168492a45c6b3f67d651
385
- react-native-enriched-markdown@1.2.0-t3.16: 542e6932066897941f54b902fa7823b2a1861c4a741b5369d5c2d49bd18485a2
385
react-native-gesture-handler@3.3.0: abe20e1d1c23549297cbbc818e14fe479b41455930d9663135d6b40fe359b626
386
react-native-image-viewing@0.2.2: 4aa038d541c7ddcc8f1437eb3e7b4f769f61de78e7f91b53f9805dfca608474d
387
react-native-keyboard-controller@1.22.8: 4e9b5a52aa8c1f9de8082bad281ee979df7860fc77ec49820d4ed00c3c7cc5a2
@@ -736,8 +735,8 @@ importers:
735
specifier: 0.25.1
736
version: 0.25.1(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0)
737
react-native-enriched-markdown:
739
- specifier: file:deps/react-native-enriched-markdown-1.2.0-t3.16-29ddd424.tgz
740
- version: file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-t3.16-29ddd424.tgz(patch_hash=542e6932066897941f54b902fa7823b2a1861c4a741b5369d5c2d49bd18485a2)(katex@0.16.47)(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0)
738
+ specifier: file:deps/react-native-enriched-markdown-1.2.0-t3.18-4287c5d3.tgz
739
+ version: file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-t3.18-4287c5d3.tgz(katex@0.16.47)(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0)
740
react-native-gesture-handler:
741
specifier: 3.3.0
742
version: 3.3.0(patch_hash=abe20e1d1c23549297cbbc818e14fe479b41455930d9663135d6b40fe359b626)(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0)
@@ -10969,9 +10968,9 @@ packages:
10968
react: '*'
10969
react-native: '*'
10970
10972
- react-native-enriched-markdown@file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-t3.16-29ddd424.tgz:
10973
- resolution: {integrity: sha512-Ru0Uuhq4QBphcC73ney0fgNnvr6Lfv+31H2Ij1qxvDejwVyFh/Romc1a1ot9i8/jnmgvAzTZzbPQcdGtQNFayw==, tarball: file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-t3.16-29ddd424.tgz}
10974
- version: 1.2.0-t3.16
10971
+ react-native-enriched-markdown@file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-t3.18-4287c5d3.tgz:
10972
+ resolution: {integrity: sha512-zVB0Kaac8iNHumPDCV/CBR3I8p+lbFIO56kQGyIMH7ja5I6mHBhw1R/l48TkNye3wk2wsXXX51m1FYa9o+OwDQ==, tarball: file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-t3.18-4287c5d3.tgz}
10973
+ version: 1.2.0-t3.18
10974
peerDependencies:
10975
katex: '>=0.16.0'
10976
react: '*'
@@ -21246,7 +21245,7 @@ snapshots:
21245
react: 19.3.0
21246
react-native: 0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6)
21247
21249
- react-native-enriched-markdown@file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-t3.16-29ddd424.tgz(patch_hash=542e6932066897941f54b902fa7823b2a1861c4a741b5369d5c2d49bd18485a2)(katex@0.16.47)(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0):
21248
+ react-native-enriched-markdown@file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-t3.18-4287c5d3.tgz(katex@0.16.47)(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0):
21249
dependencies:
21250
react: 19.3.0
21251
react-native: 0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6)
pnpm-workspace.yaml
+1
-3
@@ -23,7 +23,7 @@ allowBuilds:
23
node-pty: true
24
# Ships N-API prebuilds; its install script only rebuilds from source.
25
objc-js: false
26
- "react-native-enriched-markdown@file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-t3.16-29ddd424.tgz": true
26
+ "react-native-enriched-markdown@file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-t3.18-4287c5d3.tgz": true
27
sharp: true
28
utf-8-validate: false
29
workerd: false
@@ -262,8 +262,6 @@ patchedDependencies:
262
# Observe the owned host exit independently of descendants retaining its stdio.
263
"@muse-code/sdk@1.4.6": patches/@muse-code__sdk@1.4.6.patch
264
app-builder-lib@26.16.1: patches/app-builder-lib@26.16.1.patch
265
- # A newline in a copied table cell becomes <br>, so Copy as Markdown keeps the row whole.
266
- react-native-enriched-markdown@1.2.0-t3.16: patches/react-native-enriched-markdown@1.2.0-t3.16.patch
265
# A failed Artifacts.cached effect hangs every later caller: https://github.com/alchemy-run/alchemy/issues/2981
266
alchemy@2.0.0-beta.85: patches/alchemy@2.0.0-beta.85.patch
267