BoostIO / BoostNote-Legacy

This repository is outdated and new Boost Note app is available! We've launched a new Boost Note app which supports real-time collaborative writing. https://github.com/BoostIO/BoostNote-App
Other
17.07k stars 1.47k forks source link

Make automatic enumeration more restrictive #3610

Open arcturus140 opened 4 years ago

arcturus140 commented 4 years ago

Current behavior

In Markdown notes, Boostnote automatically adds a new bullet point when enumeration is used, i.e the text input in the form ^\s*\d+\.\s*\S.*$ is always followed by ^\s*\d+\.\s*$

Example:

1. listelement

automatically adds a new element:

1. listelement
2.

this also works with no empty space

1.listelement
2.

Expected behavior

automatic enumeration should be triggered using the following format, instead:

current: ^\s*\d+\.\s*\S.*$ expect: ^\s*\d+\.\s+\S.*$

for the following reasons:

  1. current behaviour causes undesired behaviour in some cases, as described in #3609, #3376 and other cases
  2. it is more consistent with automatic enumeration for unordered lists

for example, Boostnote already follows this format in:

^\s*\-\s+\S.*$ ^\s*\+\s+\S.*$ ^\s*\*\s+\S.*$

Steps to reproduce

  1. create a new Markdown note
  2. insert the text 1. followed by Enter
  3. new line followed by 2. should not be appended to the text

Environment

Flexo013 commented 4 years ago

The space after the period should indeed be mandatory for the automatic enumeration.