Files
paseo/packages/app/e2e/mobile/markdown-formatting
Mohamed Boudra 6521739947 fix(markdown): preserve inline code formatting and heading sizes (#7889)
Scale inline code with the enclosing block using theme tokens, and preserve its size and font through bold and links. Use contextual package patches so clean installs reproduce the verified native source.
2026-10-26 11:22:07 +07:00
..

Inline code formatting

This fixture renders the production MarkdownRenderer with plain, bold, italic, combined emphasis, strikethrough and linked code, plus bold code in headings, lists and quotes. Toggle regular/compact text. Inline code uses the theme’s code-to-body size ratio at every heading level; fenced code keeps the code-size token. Bold and links preserve the resulting size. Check the glyphs, not the background height: native backgrounds use line metrics.

Use a development client rebuilt from this checkout. Follow the temporary entry point and Metro workflow in status-ring, importing MarkdownFormattingRegression from ./e2e/mobile/markdown-formatting/native. Open the same Metro URL in a browser to compare web. Restore index.ts afterward.

The package patch contains InlineCodeFormattingTest, which exercises actual Android spans in Robolectric native graphics mode, covering draw and measurement, span order, code inside paragraph/heading sizes, bold/italic composition, and links preserving code and emphasized prose fonts. It runs in the existing test:android CI job. To run only this regression locally, from packages/app/android after Expo prebuild:

./gradlew :react-native-enriched-markdown:testDebugUnitTest \
  --tests '*InlineCodeFormattingTest' --no-daemon --max-workers=2