mdx-editor / mdx-editor/editor

[BUG] Bold format did not get serialized with any punctuation character

Open
#484 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
3.7k
Forks
307
Avg merge
14h 22m
Merged PRs (30d)
5

Description

Describe the bug
Bold format serialized with any punctuation character cannot be rendered back.

Reproduction
quotes:
https://codesandbox.io/p/sandbox/mdx-editor-base-forked-yzft7z?file=%2Fsrc%2FApp.tsx

Exclamation mark:
https://codesandbox.io/p/sandbox/mdx-editor-base-forked-69dgt8?file=%2Fsrc%2FApp.tsx

(Originally I though it was quotes only, but after posting this bug report I reproduced it with exclamation mark)

To Reproduce
Steps to reproduce the behavior:

  1. Go to the codesandbox
    https://codesandbox.io/p/sandbox/mdx-editor-base-forked-yzft7z?file=%2Fsrc%2FApp.tsx
  2. In the first editor with markdown md1, select "b" and hit ctrl+b, it makes the "b" 3 chars bold.
  3. In the console it should shows content is now equal to md2 a**"b"**c.
  4. But in second editor with md2 as initial markdown, it renders nothing bold.

Expected behavior
Ctrl+b should make the text bold even after serialized and deserialized back.

Screenshots
image

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the two linked CodeSandbox reproductions and trace the markdown serialization and deserialization of bold text containing a quote or exclamation mark. Verify the reported round trip from the first editor to the second, and consider the issue done when both punctuation cases render bold after serialization and deserialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown, react, typescript
Domain
content, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.