diff options
author | Duncan Roe <duncan_roe@optusnet.com.au> | 2024-12-21 14:13:48 +1100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2025-01-06 11:01:41 +0100 |
commit | f54dc690e016c7eb3279d84d3409ee4f1fe9b910 (patch) | |
tree | b0f528817cb98c9d86c594c1aa10065d7a6646cb | |
parent | 809240b36408b4258fb02250e34849431de714ab (diff) |
build: doc: Only fix rendering of verbatim '\n"' when needed
commit 9f52afa60839 ("build: doc: Fix rendering of verbatim '\n"' in man
pages") worked around a doxygen bug which was fixed at doxygen 1.9.
Applying the workaround to output from a fixed doxygen version reintroduced
the bug.
Update build_man.sh to record doxygen version and only apply workaround
if that version is broken.
Fixes: 9f52afa60839 ("build: doc: Fix rendering of verbatim '\n"' in man pages")
Signed-off-by: Duncan Roe <duncan_roe@optusnet.com.au>
Signed-off-by: Florian Westphal <fw@strlen.de>
-rwxr-xr-x | doxygen/build_man.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/doxygen/build_man.sh b/doxygen/build_man.sh index 95c7569..a6531cb 100755 --- a/doxygen/build_man.sh +++ b/doxygen/build_man.sh @@ -68,6 +68,13 @@ post_process(){ # #keep_me=nfq_icmp_get_hdr.3 #do_diagnostics + + # Decide if we need to fix rendering of verbatim "\n" + i=$(doxygen --version) + doxymajor=$(echo $i|cut -f1 -d.) + doxyminor=$(echo $i|cut -f2 -d.) + [ $doxymajor -eq 1 -a $doxyminor -lt 9 ] && + fix_newlines=true || fix_newlines=false # # Work through the "real" man pages for target in $(ls -S | head -n$page_count) @@ -84,7 +91,7 @@ post_process(){ [ $# -ne 2 ] || insert_see_also $@ # Fix rendering of verbatim "\n" (in code snippets) - sed -i 's/\\n/\\\\n/' $target + $fix_newlines && sed -i 's/\\n/\\\\n/' $target }& done |