/ with `user-select: text`
+// already applied via markdownStyleMapping. The web bundle must not import
+// react-native-uitextview: its transitive import of codegenNativeComponent
+// pulls in setUpReactDevTools, which doesn't resolve under Metro's web
+// target in dev mode.
+export function MarkdownTextSpan({ style, children }: MarkdownTextSpanProps) {
+ return {children};
+}
+
+interface MarkdownParagraphViewProps {
+ paragraphStyle: ViewStyle;
+ children: ReactNode;
+}
+
+const MARKDOWN_PARAGRAPH_RESET: ViewStyle = { marginBottom: 0 };
+
+// Same shape as Android — paragraph is a View so block-level children (images)
+// keep their natural layout. Web text selection already spans nested inline
+// elements via CSS user-select, so no UITextView equivalent is needed.
+export function MarkdownParagraphView({ paragraphStyle, children }: MarkdownParagraphViewProps) {
+ const style = useMemo(() => [paragraphStyle, MARKDOWN_PARAGRAPH_RESET], [paragraphStyle]);
+ return {children};
+}
diff --git a/packages/app/src/components/message.tsx b/packages/app/src/components/message.tsx
index 753bb9948..0f0c3a3f4 100644
--- a/packages/app/src/components/message.tsx
+++ b/packages/app/src/components/message.tsx
@@ -10,6 +10,7 @@ import {
ViewStyle,
type TextStyle,
} from "react-native";
+import { MarkdownParagraphView, MarkdownTextSpan } from "@/components/markdown-text";
import * as React from "react";
import {
useState,
@@ -1527,7 +1528,7 @@ function MarkdownInheritedText({
() => [inheritedStyles, textStyle, overrideStyle],
[inheritedStyles, textStyle, overrideStyle],
);
- return {children};
+ return {children};
}
interface MarkdownListItemContentProps {
@@ -1542,18 +1543,6 @@ function MarkdownListItemContent({ contentStyle, children }: MarkdownListItemCon
return {children};
}
-interface MarkdownParagraphViewProps {
- paragraphStyle: ViewStyle;
- children: ReactNode;
-}
-
-const MARKDOWN_PARAGRAPH_RESET: ViewStyle = { marginBottom: 0 };
-
-function MarkdownParagraphView({ paragraphStyle, children }: MarkdownParagraphViewProps) {
- const style = useMemo(() => [paragraphStyle, MARKDOWN_PARAGRAPH_RESET], [paragraphStyle]);
- return {children};
-}
-
interface MarkdownListViewProps {
baseStyle: ViewStyle;
spacing: { marginTop: number; marginBottom: number };