[$175] iOS Safari - Chat - Bold and italic formatting is lost when pasting rich text

Aperta
#106,033 7 commenti 1 reazione 2 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Uzaifm127 ci sta già lavorando.

Dal 5/11/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Bug Daily External

Reproducible in staging?: Yes
Issue reported by: @Uzaifm127
Source: Follow-up from https://github.com/Expensify/App/issues/85907#issuecomment-6451147442 on Chat - Emojis pasted from Slack render as images

The Safari clipboard contains formatting information, but bold and italic text become plain text after pasting. This is separate from recognizing emoji images.

Action Performed:

  1. In Slack , enter a message containing an emoji and these three phrases: Bold,, Italic Bold,, and Italic.
  2. Use Slack's formatting controls to make Bold, bold, Italic Bold, both bold and italic, and Italic italic. Send the message and confirm that Slack displays those styles.
  3. Select and copy the whole rendered message.
  4. On iOS safari, open a chat.
  5. Clear the composer and paste the copied message.

Expected Result:

The pasted phrases retain the same bold and italic formatting shown in Slack.

Actual Result:

The words are pasted, but their bold and italic formatting is lost. The bold, bold-and-italic, and italic phrases appear as plain text.

Workaround:

Reapply the bold and italic formatting manually after pasting.

Platforms:

Platforms where the issue reproduced (other platforms not tested):

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

https://github.com/user-attachments/assets/9348903e-7fe4-48a5-b74e-8c095ddeb5bd

Root cause
  1. Safari puts the bold and italic formatting on <span> elements. For example, Bold, has a bold style, and Italic Bold, has both bold and italic styles. The formatting is in the copied HTML, but not in <b>, <strong>, <i>, or <em> tags.
  2. handlePastedHTML() sends the HTML to Parser.htmlToMarkdown(): https://github.com/Expensify/App/blob/5bd95161056013f594b1c6f01e84f046433e7f6e/src/hooks/useHtmlPaste/index.ts#L186. The parser's bold and italic rules look for those tags, so they do not recognize the formatting on Safari's <span> elements.
  3. The parser removes the remaining HTML tags, leaving only the words. That is why Bold,, Italic Bold, and Italic appear in the Composer without their copied formatting.
Issue OwnerCurrent Issue Owner: @truph01
Upwork Automation - Do Not Edit
Lingua principale
TypeScript
Stelle
5k
Fork
4k
Merge medio
3g 2h
PR unite (30g)
617

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Expensify/App

Tutte le issue di Expensify/App

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.