[Android] Text with % and markdowns inside
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 330
- Forks
- 76
- Avg merge
- 3h 6m
- Merged PRs (30d)
- 1
Description
Hi guys, I discovered serious blocker related with Text on Android. I’ve translated strings with % and markdown i.e. “Perfect! 100% bold” I try to show it by using:
Text(.init(text))Text(LocalizedStringKey(stringLiteral = text))on iOS on both cases result is correct (1st screenshot).
But on Android with solution 1 markdowns are not working (2nd screenshot) and when we use LocalizedStringKey markdowns are supported correctly but we have double % (3rd screenshot) <- probably LocalizedStringKey is escaping %.
Could you please try to fix it somehow to make consistent with iOS behavior?
Without % Text is created correctly. Replace by FULLWIDTH PERCENT SIGN": % helps.
The problem is probably somewhere here: https://github.com/skiptools/skip-foundation/blob/main/Sources/SkipFoundation/AttributedString.swift
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Sources/SkipFoundation/AttributedString.swift, then reproduce the reported strings using Text and LocalizedStringKey on Android and compare them with the iOS behavior described in the issue. Done means markdown renders correctly and a literal percent appears once for both approaches, matching the expected iOS behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100