[PATCH 2/2] scripts/kernel-doc: Do not process backslash lines in comments
Randy Dunlap
rdunlap at infradead.org
Tue Jan 23 07:00:06 UTC 2024
On 1/22/24 01:31, Anna-Maria Behnsen wrote:
> Commit 654784284430 ("kernel-doc: bugfix - multi-line macros") introduces
> pre-processing of backslashes at the end of a line to not break multi-line
> macros. This pre-processing is done independently if it is inside code or
> inside a comment.
>
> This illustation of a hierarchy as a code block inside a kernel-doc comment
> has a backslash at the end of the line:
>
> ---8<---
> /**
> * DOC: hierarchy
> *
> * Top Level
> * / \
> * Child A Child B
> */
> ---8<---
>
> It will be displayed as:
>
> ---8<---
> Top Level
> / * Child A Child B
> ---8<---
>
> To prevent this, do the pre-processing only for lines which are no
> comments, e.g. do not start with ' *'.
>
> Suggested-by: Matthew Wilcox <willy at infradead.org>
> Signed-off-by: Anna-Maria Behnsen <anna-maria at linutronix.de>
I compared several hundred html files before and after this patch
and they were all the same, so I will say:
Tested-by: Randy Dunlap <rdunlap at infradead.org>
Thanks.
> ---
> scripts/kernel-doc | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/kernel-doc b/scripts/kernel-doc
> index e8aefd258a29..4277af79de86 100755
> --- a/scripts/kernel-doc
> +++ b/scripts/kernel-doc
> @@ -2331,7 +2331,7 @@ sub process_file($) {
>
> $section_counter = 0;
> while (<IN_FILE>) {
> - while (s/\\\s*$//) {
> + while (!/^ \*/ && s/\\\s*$//) {
> $_ .= <IN_FILE>;
> }
> # Replace tabs by spaces
--
#Randy
More information about the dri-devel
mailing list