ITADN

fix: Line parsed as body even if missing empty line

#4656Openmartibenn 创建于 2026-03-13
bug
M
martibenncommented
### Steps to Reproduce ```bash 1. First step on a message : feat(core): some subject with its second line under with only one carriage return A body after an empty line 2. Second step Parse it in CommitParser ``` ### Current Behavior The result is : ``` { "type": "feat", "scope": "core", "subject": "some subject with" <================================= "body": " its second line under with only one carriage return\n\n A body", <===== "merge": null, "revert": null, "header": "feat(core): some subject with", "footer": null, "notes": [], "mentions": [], "references": [], } ``` ### Expected Behavior ``` { "type": "feat", "scope": "core", "subject": "some subject with\nits second line under with only one carriage return" <==== "body": "A body", <============================================= "merge": null, "revert": null, "header": "feat(core): some subject with", "footer": null, "notes": [], "mentions": [], "references": [], } ``` ### Affected packages - [ ] cli - [x] core - [ ] prompt - [ ] config-angular ### Possible Solution _No response_ ### Context Following convention commit specs : ``` <type>[optional scope]: <description> [optional body] [optional footer(s)] ``` optional body is after a blank line So I'm not sure that's correct to consider that the body start after the subject new line, could it be blank or not ### commitlint --version @commitlint/cli@20.4.4 ### git --version git version 2.52.0 ### node --version v24.13.0
0 条评论