Problem pasting HTML into Markdown composer on mobile (until pasting once into rich text editor)

AI-generated summary

The discussion reports a bug where pasting HTML content into the Markdown composer on mobile fails to preserve formatting unless the content is first pasted into the rich text editor. sk-or-v1-contents details the issue on Edge for Android, noting that direct pasting in Markdown mode results in plain text, while pasting into rich text mode followed by Markdown mode correctly converts HTML to Markdown. This behavior resets upon page refresh if the content is not re-copied. The reporter suspects the issue lies in how text is copied.

renato identifies this as a likely upstream bug in Chromium for Android and mentions working on a workaround. However, renato later questions if the bug is specific to Edge, as they cannot reproduce it in Chrome or other Chromium builds. The original poster agrees to test on Chrome to determine if the issue is browser-specific, though it will take some time to set up.

Priority/Severity: Moderate?

Platform:
Edge on Android, try.discourse.org (can reproduce in safe mode), device in vertical state
Cannot reproduce if using browser’s Desktop mode.

Description:
On mobile, the Markdown editor does not paste HTML as Markdown until it is pasted once into the rich text editor. (There are other conditions, see below)

Reproducible steps:

  1. Go to a post with some HTML markup, like Aaa aa aa aaaa aaaa aa ohgkgjsyduq - general - Discourse Demo
  2. Copy some formatted Markdown content
  3. Open the composer, select Markdown mode, and paste, and observe
  4. Select rich text mode and paste
  5. Paste in Markdown mode again and observe

Step 3 pastes the text as plain text, losing HTML formatting. Step 5 converts HTML into Markdown.

After step 5, pasting HTML into Markdown editor preserves markup until page is refreshed and text is copied again. (If you refresh after step 5 and paste into Markdown editor again without re-copying, markup is preserved)

I think this has something to do with the way text is copied?

2 Likes

thanks for reporting @renato is having a look a this.

Hello, it’s been 3 weeks, just pinging is there any progress on this?

1 Like

Sorry, no news, it is on @renato’s list.

2 Likes

This looks a lot like an upstream bug on Chromium for Android, I’ve been trying a workaround that I intend to push this week (and I’ll review the bug surface to report upstream if that’s really the case).

3 Likes

Hello, just want to ping on this, is there any progress?

Nothing much, it seems like this is likely a Android bug.

1 Like

I can’t reproduce it using Google Chrome or a Chromium build. Can you reproduce on those browsers as well, or is it only happening on Edge?

1 Like

I’ll try to reproduce on Chrome, but it might be some time later since I need to install it first