Browse Source

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 <[email protected]>
Simon McVittie 2 weeks ago
parent
commit
99da009308
1 changed files with 1 additions and 0 deletions
  1. 1 0
      build-scripts/wikiheaders.pl

+ 1 - 0
build-scripts/wikiheaders.pl

@@ -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;