Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/mobile/deps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ Push `main` and the tag before submitting the app change, replace the old archiv

## `react-native-enriched-markdown`

Built from `main` of [aislopware/enriched-markdown](https://github.com/aislopware/enriched-markdown). Its `oni-fork.json` records the exact source commit and upstream base. React block renderers, signed image sources, the `onLinksChange` link list (`renderers`, `resolveImageSource`, `onLinksChange`), the iOS streaming memory bounds and iOS Copy as Markdown keeping bold spans whole 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)), line breaks in copied table cells written as `<br>` ([#1144](https://github.com/software-mansion/enriched-markdown/pull/1144)), and Android measuring text in the span order its view draws it, so code blocks nested in list items no longer make a reply overlap the next message ([#1145](https://github.com/software-mansion/enriched-markdown/pull/1145)). It also carries three fork-only changes. `writingDirection="word-majority"` sets each paragraph, list item, heading and table cell right to left when its right-to-left words outnumber its left-to-right ones. It counts words as the desktop client does, but decides per paragraph where desktop decides per top-level block (Android API 29+; older Android keeps first-strong). The other two come from T3 Code's fork: iOS code blocks too big for one backing store draw through tiles, so a tall block with long lines no longer shows an empty pane ([pingdotgg/enriched-markdown#15](https://github.com/pingdotgg/enriched-markdown/pull/15)), and a long-pressed iOS blockquote lifts on the background it sits on instead of drawing its text over the thread.
Built from `main` of [aislopware/enriched-markdown](https://github.com/aislopware/enriched-markdown). Its `oni-fork.json` records the exact source commit and upstream base. React block renderers, signed image sources, the `onLinksChange` link list (`renderers`, `resolveImageSource`, `onLinksChange`), the iOS streaming memory bounds and iOS Copy as Markdown keeping bold spans whole 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)), line breaks in copied table cells written as `<br>` ([#1144](https://github.com/software-mansion/enriched-markdown/pull/1144)), and Android measuring text in the span order its view draws it, so code blocks nested in list items no longer make a reply overlap the next message ([#1145](https://github.com/software-mansion/enriched-markdown/pull/1145)). It also carries five fork-only changes. A table inside a list item renders as a table indented under the item's text, with the list around it keeping its markers and numbers; the native renderers only split top-level blocks into views, so it used to run its cells together as text. `table.lines: 'rows'` draws tables as desktop does: lines between rows only, no outer border, and outer columns flush with the text. `writingDirection="word-majority"` sets each paragraph, list item, heading and table cell right to left when its right-to-left words outnumber its left-to-right ones. It counts words as the desktop client does, but decides per paragraph where desktop decides per top-level block (Android API 29+; older Android keeps first-strong). The last two come from T3 Code's fork: iOS code blocks too big for one backing store draw through tiles, so a tall block with long lines no longer shows an empty pane ([pingdotgg/enriched-markdown#15](https://github.com/pingdotgg/enriched-markdown/pull/15)), and a long-pressed iOS blockquote lifts on the background it sits on instead of drawing its text over the thread.

To replace it, commit the fork changes on `main` with the next `1.2.0-oni.N` version, run `yarn install --immutable` and `yarn workspace react-native-enriched-markdown prepare` in the fork checkout, then `yarn workspace react-native-enriched-markdown pack:onicode /absolute/path/to/onicode/apps/mobile/deps`. Tag the source commit `oni-v<version>` and push `main` and the tag to the fork. Rename the archive to include the first eight characters of the source commit, as in `react-native-enriched-markdown-<version>-<commit>.tgz`, so each build has a distinct dependency path. Update the tarball path in `apps/mobile/package.json` and `pnpm-workspace.yaml`'s `allowBuilds`, and run `vp i` to update the lockfile.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion apps/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"react": "catalog:",
"react-dom": "catalog:",
"react-native": "0.88.1",
"react-native-enriched-markdown": "file:deps/react-native-enriched-markdown-1.2.0-oni.25-40e822ce.tgz",
"react-native-enriched-markdown": "file:deps/react-native-enriched-markdown-1.2.0-oni.26-c09c93bb.tgz",
"react-native-gesture-handler": "~3.5.0",
"react-native-image-viewing": "^0.2.2",
"react-native-keyboard-controller": "1.23.1",
Expand Down
10 changes: 7 additions & 3 deletions apps/mobile/src/native/EnrichedMarkdownText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ function enrichedStyle(
const monospace = Platform.OS === "ios" ? "Menlo" : "monospace";
// Android only bolds fallback glyphs when the bold family is asked for at a bold weight (app.config.ts).
const boldFontWeight = Platform.OS === "android" ? "bold" : undefined;
// Keep the radius modest: iOS clips square table-cell borders without stroking the corner arcs.
const block = {
marginTop: 4,
marginBottom: 12,
Expand Down Expand Up @@ -161,15 +160,20 @@ function enrichedStyle(
gapWidth: 12 * fontScale,
},
thematicBreak: { color: style.dividerColor, height: 1, marginTop: 8, marginBottom: 8 },
// As desktop draws tables: lines between rows only, outer columns flush with the prose, one step smaller.
table: {
...body,
...block,
fontSize: style.fontSize * (14 / 15),
lineHeight: style.lineHeight * (14 / 15),
headerFontFamily: style.boldFontFamily,
headerTextColor: style.strongColor,
headerBackgroundColor: style.codeBlockBackgroundColor,
headerBackgroundColor: "transparent",
rowEvenBackgroundColor: "transparent",
rowOddBackgroundColor: "transparent",
cellPaddingHorizontal: 10,
borderRadius: 0,
lines: "rows",
cellPaddingHorizontal: 12,
cellPaddingVertical: 7,
},
taskList: {
Expand Down
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ allowBuilds:
objc-js: false
# Its postinstall only prints a banner.
react-native-pdf-jsi: false
"react-native-enriched-markdown@file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-oni.25-40e822ce.tgz": true
"react-native-enriched-markdown@file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-oni.26-c09c93bb.tgz": true
sharp: true
utf-8-validate: false
# Verifies the workerd binary for the push gateway's local dev server.
Expand Down
Loading