From 914cad888fe6f3d084d8569c1d90aece308cc83a Mon Sep 17 00:00:00 2001 From: Martijn Visser Date: Sun, 2 Jan 2022 19:23:59 +0100 Subject: [PATCH 1/3] remove trailing whitespace for Clang.Paragraph --- src/generator/documentation.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generator/documentation.jl b/src/generator/documentation.jl index 840c265a..d7ee1c7d 100644 --- a/src/generator/documentation.jl +++ b/src/generator/documentation.jl @@ -283,8 +283,8 @@ end function format_block(x::Clang.Paragraph, options) t = format_inline(x, options) - # Remove leading space - t = replace(t, r"^\s+"=>"") + # Remove leading and trailing whitespace + t = strip(t) [t] end From a72a2fe8a395d7fb1037efd67fd28d68bd03269f Mon Sep 17 00:00:00 2001 From: Martijn Visser Date: Sun, 2 Jan 2022 19:29:56 +0100 Subject: [PATCH 2/3] remove empty lines in Parameters or Returns lists --- src/generator/documentation.jl | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/generator/documentation.jl b/src/generator/documentation.jl index d7ee1c7d..c9b6c685 100644 --- a/src/generator/documentation.jl +++ b/src/generator/documentation.jl @@ -243,13 +243,11 @@ function format_doxygen(cursor, options, members=false) push!(lines, "### Parameters") for p in parameters append!(lines, format_parameter(p, options)) - push!(lines, "") end end if !ismissing(returns) push!(lines, "### Returns") append!(lines, format_block(Clang.getParagraph(returns), options)) - push!(lines, "") end if !isempty(member_docs) append!(lines, member_docs) From 06e3dc5cf221d55c4ed7d6fe2627841f3dee6cca Mon Sep 17 00:00:00 2001 From: Martijn Visser Date: Sun, 2 Jan 2022 19:45:36 +0100 Subject: [PATCH 3/3] strip trailing whitespace after parameter --- src/generator/documentation.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/generator/documentation.jl b/src/generator/documentation.jl index c9b6c685..1708408e 100644 --- a/src/generator/documentation.jl +++ b/src/generator/documentation.jl @@ -264,6 +264,7 @@ function format_parameter(p, options) name = Clang.getParamName(p) dir = parameter_pass_direction_name(Clang.getDirection(p)) content = format_inline.(children(p), Ref(options)) + content[end] = rstrip(content[end]) ["* `$name`:$dir$(content[1])"; @view content[2:end]] end