Project

General

Profile

Actions

Feature #43095

open

Support automatic list marker insertion in textareas

Added by Mizuki ISHIKAWA 23 days ago. Updated 4 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
UI
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

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

Actions #2

Updated by Go MAEDA 23 days ago

  • Target version set to Candidate for next major release
Actions #3

Updated by Mizuki ISHIKAWA 19 days ago

I’ve reposted the patch with support for the 1) syntax in CommonMark and some minor behavior fixes.

Actions #4

Updated by Marius BĂLTEANU 14 days ago

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).

Actions #5

Updated by Mizuki ISHIKAWA 4 days ago

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.

Actions

Also available in: Atom PDF