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

Desktop, Mobile: Fixes #10891: Markdown editor: Fix toggling bulleted lists when items start with asterisks #10902

Merged

Conversation

personalizedrefrigerator
Copy link
Collaborator

Summary

This pull request requires a space after the starting * or - in a bulleted list. Previously, markup similar to **test** was considered a bulleted list item by the list-toggling regular expression.

This should fix #10891.

Notes

When continuing or creating a new bulleted list with toolbar buttons, a space seems to be automatically added after the leading -. As such, it shouldn't be necessary to handle the case where - is followed by an end-of-line or end-of-document.

Testing plan

  1. Start the desktop app (CodeMirror 6 markdown editor enabled).
  2. Create a new note with the following content:
    **test**
    test
    *test*
    
    1. This
    2. is
    3. a
    4. test
    
    List:
    - This
    - is
      a
    - test
        - TEST!
    
  3. Select
    **test**
    test
    *test*
    
  4. Click the "toggle bulleted list" button.
  5. Verify that the selected items are now in a bulleted list.
  6. Click "toggle bulleted list" again.
  7. Verify that the bulleted list has been removed.
  8. Select the bottommost bulleted list and click "toggle bulleted list".
  9. Verify that the bulleted list has been removed.
  10. Add a header near the end of the document on a blank line. Press enter.
  11. At the end of the document, press "toggle bulleted list".
  12. Type.
  13. Verify that a single bulleted list item has been added.

… bulleted lists when items start with asterisks
@laurent22 laurent22 merged commit 7801502 into laurent22:dev Aug 22, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Beta editor: Applying list formatting deletes leading asterisk
2 participants