@@ -12,7 +12,7 @@ import {
1212 markdownWithTableBreaks ,
1313} from "../lib/markdownDocument" ;
1414import { isValidElement , useMemo , useState , type ReactNode } from "react" ;
15- import { Platform , Share , StyleSheet , View } from "react-native" ;
15+ import { Platform , Share , StyleSheet , useWindowDimensions , View } from "react-native" ;
1616import {
1717 EnrichedMarkdownText ,
1818 type MarkdownImageBlock ,
@@ -35,6 +35,7 @@ import {
3535function enrichedStyle (
3636 style : SelectableMarkdownTextProps [ "textStyle" ] ,
3737 dark : boolean ,
38+ fontScale : number ,
3839) : MarkdownStyle {
3940 const monospace = Platform . OS === "ios" ? "Menlo" : "monospace" ;
4041 // Keep the radius modest: iOS clips square table-cell borders without stroking the corner arcs.
@@ -132,7 +133,13 @@ function enrichedStyle(
132133 borderWidth : 2 ,
133134 gapWidth : 12 ,
134135 } ,
135- list : { ...body , bulletColor : style . mutedColor , markerColor : style . mutedColor , gapWidth : 6 } ,
136+ list : {
137+ ...body ,
138+ bulletColor : style . mutedColor ,
139+ markerColor : style . mutedColor ,
140+ // The bullet is centred on the gap's edge and scales with the system text size; the gap must too.
141+ gapWidth : 12 * fontScale ,
142+ } ,
136143 thematicBreak : { color : style . dividerColor , height : 1 , marginTop : 8 , marginBottom : 8 } ,
137144 table : {
138145 ...body ,
@@ -256,9 +263,13 @@ export function MobileEnrichedMarkdownText(props: SelectableMarkdownTextProps) {
256263 mimeTypes : { "app.t3.context-fragment" : props . contextClipboardFragment ! } ,
257264 } ;
258265 } , [ props . contextClipboardFragment , props . markdown ] ) ;
266+ const { fontScale } = useWindowDimensions ( ) ;
259267 const markdownStyle = useMemo (
260- ( ) => ( { ...enrichedStyle ( props . textStyle , themeAppearance === "dark" ) , linkVariants } ) ,
261- [ props . textStyle , themeAppearance , linkVariants ] ,
268+ ( ) => ( {
269+ ...enrichedStyle ( props . textStyle , themeAppearance === "dark" , fontScale ) ,
270+ linkVariants,
271+ } ) ,
272+ [ props . textStyle , themeAppearance , fontScale , linkVariants ] ,
262273 ) ;
263274 const renderers = renderImage
264275 ? {
0 commit comments