framework icon indicating copy to clipboard operation
framework copied to clipboard

Numbered List Not Working in Editor

Open Magda-tester opened this issue 1 year ago • 1 comments

Current Behavior

Numbered list does not work when adding replies or creating new discussions.

Current Result: Numbered list does not add more than "1." when creating lists. Steps to Reproduce

Steps to Reproduce

  1. Go to the forum
  2. Log in to your account
  3. Enter any discussion or start a new one
  4. Click the numbered list icon in the editor toolbar
  5. Try to create multiple numbered items by pressing Enter

Expected Behavior

After pressing the Enter button, consecutive numbers should be added to the numbered list (1., 2., 3., etc.).

Screenshots

https://github.com/user-attachments/assets/aa0e144e-e485-4d67-8d0a-b8139603e9e9

Environment

  • Flarum version: 1.8.7
  • PHP version: 8.3.21
  • Browser: Chrome - version 138.0.7204.184; Firefox - version 141.0

Magda-tester avatar Aug 05 '25 07:08 Magda-tester

I looked into this. The root cause is that the Markdown editor has no list continuation at all: pressing Enter just inserts a plain newline. The toolbar's "ordered list" button only ever prefixes the current line, and it always starts at 1., so the only way to add items is to re-click the button — which keeps producing 1.. That's why a numbered list never gets past 1..

I've opened #4778, which makes Enter inside a list item continue the list: ordered lists increment (1. → 2. → 3.), unordered lists repeat the bullet, and pressing Enter on an empty item ends the list — the behaviour you'd expect from most Markdown editors.

Note this is the plain Markdown editor; if you have the FoF Rich Text extension enabled, it uses its own editor that already handles this.

karl-bullock avatar Jun 22 '26 22:06 karl-bullock