StackExchange / StackExchange/Stacks-Editor
bug(commonmark) Formatting within link in Markdown gets moved outside the link in translation
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 437
- Forks
- 61
- Avg merge
- 16h 2m
- Merged PRs (30d)
- 8
Description
Describe the bug
Toggling from Markdown to rich text and back to Markdown causes asterisks (in the placeholder text for links) to be displaced.

To Reproduce
Steps to reproduce the behavior:
- Go to MD mode. Type in
[**this is a link**](https://google.com) - Toggle to RT and back to MD
- Text is now
**[this is a link](https://google.com)**
Expected behavior
Any markdown formatting that was within the link in markdown should stay within the link
Desktop (please complete the following information):
Windows 11 Chrome 103
Additional context
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported Markdown-to-rich-text-to-Markdown sequence with [**this is a link**](https://google.com). Trace the translation path that moves the asterisks outside the link and verify the result preserves formatting inside the link; add or update a regression test if the relevant test location is found.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100