-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix textarea newline handle #32966
fix textarea newline handle #32966
Conversation
} else { | ||
// start a new line with the same indention and prefix | ||
let newPrefix = prefix; | ||
// a simple approach, otherwise it needs to parse the lines after the current line | ||
if (/^\d+\./.test(prefix)) newPrefix = `1. ${newPrefix.slice(newPrefix.indexOf('.') + 2)}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what old code does
got it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment above // a simple approach, otherwise it needs to parse the lines after the current line
I guess it's not right for this case:
Your result might be
? I didn't do that (auto-increase) because it needs a complex algorithm to make it right. And for most cases only using I added a new test: |
@wxiaoguang should i revert the increase number code or try to implement increasing numbers below? |
Either is fine, but there are many edge cases, even GitHub doesn't get it completely right, and it would be quite complex, maybe at least hundreds lines of code in my mind. So at the moment, I would prefer to revert "the increase number" |
@wxiaoguang done |
- Fix cursor position if input newline on middle of lines - ~Increment number if numbered list~ ![image](https://github.com/user-attachments/assets/bcfe2625-11a8-4ea4-9a71-b7ecfe81b2e0) --------- Co-authored-by: wxiaoguang <[email protected]>
Backport #32966 by metiftikci Co-authored-by: metiftikci <[email protected]> Co-authored-by: wxiaoguang <[email protected]>
* giteaofficial/main: demilestone should not include milestone (go-gitea#32923) fix textarea newline handle (go-gitea#32966) Fix Azure blob object `Seek` (go-gitea#32974) Fix maven pom inheritance (go-gitea#32943) Refactor arch route handlers (go-gitea#32972) [skip ci] Updated translations via Crowdin Refactor tmpl and blob_excerpt (go-gitea#32967) Clarify path param naming (go-gitea#32969) Refactor getpatch/getdiff functions and remove unnecessary fallback (go-gitea#32817) Refactor request context (go-gitea#32956)
I have made a complete fix : Fix editor markdown not incrementing in a numbered list #33187 |
Increment number if numbered list