Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escaping '#' inside bullet lists doesn't round-trip #234

Open
dionrhys opened this issue Nov 30, 2022 · 0 comments
Open

Escaping '#' inside bullet lists doesn't round-trip #234

dionrhys opened this issue Nov 30, 2022 · 0 comments
Labels
bug Something isn't working commonmark Relates to commonmark round-tripping or syntax

Comments

@dionrhys
Copy link
Member

Describe the bug
Within list items, # at the start of the text needs to be escaped to not turn the text into a heading. We can escape that by writing \#, but flipping between rich text and markdown removes the backslash, making the text within the list item a heading again.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://editor.stackoverflow.design/

  2. Switch to Markdown mode and paste:

    \# test
    
    - \# test
    
    \# test
  3. Flip to rich text mode, see that # is shown as expected

    Screenshot

    Screenshot showing rich text mode the first time

  4. Flip to Markdown mode, see that # is no longer escaped

    Screenshot

    Screenshot showing markdown mode with changed content

  5. Flip to rich text mode, see that the text is now a <h1> heading

    Screenshot

    Screenshot showing rich text mode the second time

Expected behavior
The editor should keep the needed backslash escape on the # character so that it doesn't turn the text into a heading.

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Firefox
  • Version: 107.0
@dionrhys dionrhys added the bug Something isn't working label Nov 30, 2022
@b-kelly b-kelly added the commonmark Relates to commonmark round-tripping or syntax label Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working commonmark Relates to commonmark round-tripping or syntax
Projects
Status: Todo
Development

No branches or pull requests

2 participants