You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The markdown toolbar currently has formatters for both ordered and unordered lists. Clicking the button will convert any highlighted text into a list by inserting - or e.g. 1. before each item. If no text is highlighted then an empty list is started.
We'd like to enhance this functionality by ensuring that as a user types their list, and presses Enter, we automatically insert the next line of list formatting.
Example: ordered list
Given the following text exists, with the cursor at the end of "Line 2":
1. Line one
2. Line two
If the user now types Enter, they should see:
1. Line one
2. Line two
3.
And their cursor should be positioned after the 3.
Example: unordered list
Given the following text exists, with the cursor at the end of "Line 2":
- Line one
- Line two
If the user now types Enter, they should see:
- Line one
- Line two
-
And their cursor should be positioned after the -
"Cancelling" the list formatting
We want an easy way for users to "escape" the list formatting - after we "auto insert" the next line of list formatting, if a user presses Enter again without adding any list item, we want to clear the formatting we inserted.
To continue the example above, given we have inserted 3. below:
1. Line one
2. Line two
3.
If a user immediately presses Enter again, the 3. is cleared, leaving:
1. Line one
2. Line two
With the cursor remaining on the empty line under "Line two"
The text was updated successfully, but these errors were encountered:
Thanks for the issue, we will take it into consideration! Our team of engineers is busy working on many types of features, please give us time to get back to you.
Feature requests that require more discussion may be closed. Read more about our feature request process on forem.dev.
To our amazing contributors: issues labeled bug are always up for grabs, but for feature requests, please wait until we add a ready for dev before starting to work on it.
To claim an issue to work on, please leave a comment. If you've claimed the issue and need help, please ping @forem-team. The OSS Community Manager or the engineers on OSS rotation will follow up.
For full info on how to contribute, please check out our contributors guide.
aitchiss
changed the title
Automatically add <code class="notranslate">n+1 number or <code class="notranslate">- for lists when hitting <code class="notranslate">Enter` key
Markdown toolbar: auto-continue ordered and unordered lists
May 18, 2022
The markdown toolbar currently has formatters for both ordered and unordered lists. Clicking the button will convert any highlighted text into a list by inserting
-
or e.g.1.
before each item. If no text is highlighted then an empty list is started.We'd like to enhance this functionality by ensuring that as a user types their list, and presses
Enter
, we automatically insert the next line of list formatting.Example: ordered list
Given the following text exists, with the cursor at the end of "Line 2":
If the user now types
Enter
, they should see:And their cursor should be positioned after the
3.
Example: unordered list
Given the following text exists, with the cursor at the end of "Line 2":
If the user now types
Enter
, they should see:And their cursor should be positioned after the
-
"Cancelling" the list formatting
We want an easy way for users to "escape" the list formatting - after we "auto insert" the next line of list formatting, if a user presses
Enter
again without adding any list item, we want to clear the formatting we inserted.To continue the example above, given we have inserted
3.
below:If a user immediately presses
Enter
again, the3.
is cleared, leaving:With the cursor remaining on the empty line under "Line two"
The text was updated successfully, but these errors were encountered: