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.
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)
Open the composer, select Markdown mode, and paste, and observe
Select rich text mode and paste
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?
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).