wikiheaders: Escape backslash in man pages

Otherwise, groff will interpret it as a macro, causing the man page
for SDL_GetPrefPath() to be mis-rendered. Escape unescaped backslashes
as `\(rs` ("reverse solidus") before escaping other characters with
macros that, themselves, contain backslashes.

Resolves: https://github.com/libsdl-org/SDL/issues/13039
Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie
2025-08-30 19:39:24 +01:00
committed by Ryan C. Gordon
parent 5505cb2bb9
commit 99da009308

View File

@@ -436,6 +436,7 @@ sub dewikify_chunk {
}
} elsif ($dewikify_mode eq 'manpage') {
# make sure these can't become part of roff syntax.
$str =~ s/\\/\\(rs/gms;
$str =~ s/\./\\[char46]/gms;
$str =~ s/"/\\(dq/gms;
$str =~ s/'/\\(aq/gms;