skiptools / skiptools/skip-ui

[Android] Text with % and markdowns inside

Open
#331 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug good first issue help wanted
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?

Image Image Image

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.