Feature #43095
closed
Support automatic list marker insertion in textareas
Added by Mizuki ISHIKAWA about 2 months ago.
Updated about 15 hours ago.
Description
When editing a text using Markdown or Textile formatting, it's helpful to automatically insert the next list marker when pressing Enter after a list item.
This patch introduces a Stimulus controller that detects the current line and autofills the appropriate marker for both ordered and unordered lists, depending on the selected text formatting.
The behavior includes:
- Autofilling the next bullet or number when pressing Enter
- Removing the list marker when pressing Enter on an empty list item
- Support for nested lists
- Compatible with both Textile and CommonMark
- Properly ignores Enter key during text composition with IME (e.g. Japanese input). this is implemented using compositionstart and compositionend events, which have been supported by all major browsers since 2015 and are stable to use.
It improves editing efficiency for users writing structured content.

Files
I've corrected the warning on the lint and will reattach it.
- Target version set to Candidate for next major release
I’ve reposted the patch with support for the 1) syntax in CommonMark and some minor behavior fixes.
Thanks Mizuki for working on this patch. Before integrating this, we need first to adapt the current implementation of jstoolbar to Stimulus. I've some working code on my local environment, but it is not ready, the main concern that I have now is how can I rewrite it without being a major breaking change.
One option that I thought about is to completely write (based on the existing code) a new component to Stimulus and keep both implementation on
6.1.0 even if that will mean some duplicated code:
- in core we will use only the new one based on Stimulus
- plugin developers will have enough time to move their implementation to the new toolbar component.
- in Redmine 7, we remove the jstoolbar legacy.
One more advantage of moving now to Stimulus for JS toolbar is that we cleanup up the views and we can start experimenting Turbo for some views (like news) and, also, to async load the edit form in issue and other pages in order to enable the check / uncheck task list items without handling the event on both backend and frontend (#39130).
Marius BĂLTEANU
I think the vision of moving jstoolbar to Stimulus and introducing asynchronous loading is wonderful! I'm really looking forward to it!
As for the auto-completion feature for list markers, I agree that in the long run it probably makes sense to integrate this into jstoolbar. However, at this stage it’s a separate feature—similar to auto_complete—so I believe it could be implemented independently without waiting for the jstoolbar migration to Stimulus.
I've attached an updated patch file with the following changes:
- Ensured proper behavior in Safari.
- Enabled marker completion for all text areas with jstoolbar.
- Added explanatory comments for the regular expressions.
This update was created with the help of Katsuya HIDAKA.
I'm reattaching the patch because there were some missing changes.
I have tested the patch in #note-7 and confirmed that it works well.
- Tested with Chrome, Firefox, Safari, and MS Edge
- Works with both Textile and Markdown
- Works in all text areas that accept Textile/Markdown
This feature is implemented as a standalone Stimulus controller, so I believe it would be easy to integrate even in future development of related functionality.
I believe this feature will clearly improve the input experience in Redmine. It should also contribute to its modernization. I hope it will be introduced.
- Target version changed from Candidate for next major release to 6.1.0
- Target version changed from 6.1.0 to 7.0.0
Marius, I noticed that you changed the target version of this issue to 7.0.0.
Would it be possible to include it in version 6.1.0 instead?
I don't see any concerns with committing this patch. On the contrary, it brings a significant usability improvement for textareas, so I believe it would be better to deliver it to users as soon as possible. If we wait until 7.0.0, users will only get this feature about a year from now.
Could you please reconsider and move the target version back to 6.1.0?
I've committed the patch, but please be aware:
- it's quite a lot of code added with a few days before the release
- the feature doesn't work for task list items
- the code needed to be part of the JS toolbar because it extends its functionality and it is not a completely different feature like the auto_completes. In auto_completes, we don't have code that checks for the formatter as we have here, here a quick example:
let formatter
switch (this.format) {
case 'common_mark':
formatter = new CommonMarkListFormatter()
break
case 'textile':
formatter = new TextileListFormatter()
break
default:
return
}
Anyway, it is a nice feature, I've committed it, but with concerns regarding the technical debt that we just added.
- Status changed from New to Resolved
- Assignee set to Marius BĂLTEANU
- Resolution set to Fixed
- Target version changed from 7.0.0 to 6.1.0
Thank you for committing the patch.
Improving Redmine's UI is one of the important themes, and I believe this feature is a valuable step toward enhancing the usability of the textarea. It is great that we can deliver this improvement to users in Redmine 6.1.
- Status changed from Resolved to Closed
Also available in: Atom
PDF