Markdown editor doesn't increment points in numbered lists on enter #13946

Closed
opened 2025-11-02 10:58:02 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @TheFox0x7 on GitHub (Jan 9, 2025).

Description

When making a numbered list the editor always inserts 1. as next item.

Reproduction steps:

  1. Make an issue
  2. Make a numbered list with more than one point
  3. Next point is always 1.

This has no impact on later rendering of the list, numbers are correct there.
https://demo.gitea.com/TheFox0x7/runs-on_bug/issues/1

Screenshots

image

Gitea Version

2298ff2152

Can you reproduce the bug on the Gitea demo site?

Yes

Operating System

Linux

Browser Version

Firefox 133.0.3

Originally created by @TheFox0x7 on GitHub (Jan 9, 2025). ### Description When making a numbered list the editor always inserts `1.` as next item. Reproduction steps: 1. Make an issue 2. Make a numbered list with more than one point 3. Next point is always `1.` This has no impact on later rendering of the list, numbers are correct there. https://demo.gitea.com/TheFox0x7/runs-on_bug/issues/1 ### Screenshots ![image](https://github.com/user-attachments/assets/68406360-085f-4d7f-afd4-5292115edac3) ### Gitea Version 2298ff2152 ### Can you reproduce the bug on the Gitea demo site? Yes ### Operating System Linux ### Browser Version Firefox 133.0.3
GiteaMirror added the topic/uitype/bug labels 2025-11-02 10:58:02 -06:00
Author
Owner

@harryvince commented on GitHub (Jan 9, 2025):

I could be wrong but just looking at the MarkdownEditor.ts file, can see that 1. is hardcoded in the newPrefix https://github.com/go-gitea/gitea/blob/main/web_src/js/features/comp/EditorMarkdown.ts#L100

@harryvince commented on GitHub (Jan 9, 2025): I could be wrong but just looking at the MarkdownEditor.ts file, can see that 1. is hardcoded in the newPrefix <https://github.com/go-gitea/gitea/blob/main/web_src/js/features/comp/EditorMarkdown.ts#L100>
Author
Owner

@wxiaoguang commented on GitHub (Jan 10, 2025):

The more background details are here:

I didn't do that because there will be many edge cases to make the "increment" right. While keep using 1. still make the render work right.


If there could be a (nearly) complete improvement and test, then we can use it.

Update: made some changes in #33187, it should be able to handle most edge cases now.

@wxiaoguang commented on GitHub (Jan 10, 2025): The more background details are here: * https://github.com/go-gitea/gitea/pull/32966#issuecomment-2560499604 * https://github.com/go-gitea/gitea/pull/32966#issuecomment-2560837047 I didn't do that because there will be many edge cases to make the "increment" right. While keep using `1. ` still make the render work right. ---- If there could be a (nearly) complete improvement and test, then we can use it. Update: made some changes in #33187, it should be able to handle most edge cases now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13946