StackExchange / StackExchange/Stacks-Editor
Rich text editor can generate potentially invalid commonmark
@tmcentee is already working on this.
Since Jul 11, 2022.
- Dominant language
- TypeScript
- Stars
- 437
- Forks
- 61
- Avg merge
- 16h 2m
- Merged PRs (30d)
- 8
Description
Reported on Meta.SE
Describe the bug
Overlapping bold/italic formatting leads to incorrect formatting when toggling to Markdown mode.
- In rich text mode, write some text.
- this is bold, now italic, and now?!
- Select part of the text.
- Make the selection italic.
- this is bold, now italic, and now?!
- Select some overlapping text.
- Make the selection bold.
- this is bold, now italic, and now?!
(Now bold and italic formatting is correctly applied to overlapping portions of the text.)
When switching to Markdown, the formatting is screwed up because Markdown doesn’t support overlapping formatting in this way: adjacent
*/**is ambiguous at the best of times, but Markdown wouldn’t support this even when using_to format italics.Here’s what the editor generates:
**this is bold, *now italic****, and now?!*… but as mentioned, even the following isn’t really supported by Markdown as far as I’m aware (it certainly isn’t on this site):
**this is bold, _now italic**, and now?!_
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.
Assessment
This issue has not been assessed yet.