App: Blocks of `quoted` text render incorrectly on mobile

If you haven’t already, check out our contributing guidelines for onboarding!


View the job on Upwork here.

Platform - version:

iOS and Android, build 263

Action Performed (reproducible steps):

  1. Type a sentence with code block formatting (single ticks) in the middle, like this:

This is a test to see how code renders in the middle of a sentence on mobile.

  1. Notice that it renders strangely by either breaking the line or overflowing.

Expected Result:

It should render the same way it does here on GitHub.

This is a test to see how code renders in the middle of a sentence on mobile.

Actual Result:

The line either breaks or overflows where the code formatting starts/ends

Notes/Photos/Videos:

We’ve seen multiple results from this bug. Here are some examples:

101217023-6e804a00-3635-11eb-9bb9-2e37a0eeccbb

102281699-4c22f080-3f94-11eb-878b-345b9d978e46

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (14 by maintainers)

Most upvoted comments

@sketchydroide I think this issue is hanging around for a long time. So I tried few techniques that could let us achieve the desired UI. I would like to work on this.

Problem

We(Including other contributors from the comments above) tried using a combination of Text & View tag to achieve the above UI but there are a couple of issues as follows:

  1. Text is rendered as a block box but we want inline text.
  2. In Another way, we can get the inline text but border and border-radius are not being rendered.

Solution

I had an idea of tokenizing the text. Then apply the style selectively. This is working well. I have made a small snap here.

  1. we create one wrapper component which divides the text into tokens(words) divided based on word break. This component put the text tokens inline into a view and renders it.
  2. We can then pass styles selectively to tokens and manage the border-radius for the first and last tokens.

@parasharrajat I think that might work, would be happy to see a PR using this

@sketchydroide is it okay? for ios

I think for iOS we are expect the text to be on the same line as the rest of the text. It’s wrapping well, and going to the next line correctly, but it also should be on the same line of the rest of the text, not on a new line. Web looks good

Does that make sense @aliabbasmalik8

@sketchydroide assigning to you to review incoming proposals because you were picked via auto-assigner for the issue in the Expensify repo

@laurenreidexpensify upwork account - Eduard Rubin