Skip to content

fix: fall back to default markdownStyle colors when processColor fails - #773

Open
BetterAndBetterII wants to merge 1 commit into
Expensify:mainfrom
BetterAndBetterII:fix/invalid-markdown-color-ios
Open

fix: fall back to default markdownStyle colors when processColor fails#773
BetterAndBetterII wants to merge 1 commit into
Expensify:mainfrom
BetterAndBetterII:fix/invalid-markdown-color-ios

Conversation

@BetterAndBetterII

Copy link
Copy Markdown

Summary

processColor returns undefined for invalid CSS color names such as tranparent or none. Those values were passed through to native as-is. On iOS, a nil UIColor then crashes while building NSAttributedString.

processMarkdownStyle now falls back to the matching default processed color when processColor fails. Valid colors are unchanged.

Test plan

  • npx jest src/__tests__/processMarkdownStyle.test.ts --no-coverage
  • npx tsc --noEmit

Fixes #702

Invalid names such as tranparent become undefined and crash iOS when building NSAttributedString. Keep valid colors unchanged.

Fixes Expensify#702
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@BetterAndBetterII

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

exfy-clabot Bot added a commit to Expensify/CLA that referenced this pull request Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Passing invalid color to markdownStyle causes crash on iOS

1 participant