docs: kdoc: Make body_with_blank_line parsing more flexible
authorJonathan Corbet <corbet@lwn.net>
Sat, 21 Jun 2025 20:35:04 +0000 (14:35 -0600)
committerJonathan Corbet <corbet@lwn.net>
Wed, 25 Jun 2025 17:30:26 +0000 (11:30 -0600)
commit823d6f956605cb2f009f75de138622fcd7e03817
tree00719cebd54592aac903390332718cf7c4b763aa
parent5194439d70bac001200709bf15e3bd2b96bf9efb
docs: kdoc: Make body_with_blank_line parsing more flexible

The regex in the BODY_WITH_BLANK_LINE case was looking for lines starting
with " * ", where exactly one space was allowed before the following text.
There are many kerneldoc comments where the authors have put multiple
spaces instead, leading to mis-formatting of the documentation.
Specifically, in this case, the description portion is associated with the
last of the parameters.

Allow multiple spaces in this context.

See, for example, synchronize_hardirq() and how its documentation is
formatted before and after the change.

Acked-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tested-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250621203512.223189-2-corbet@lwn.net
scripts/lib/kdoc/kdoc_parser.py