From b8ceb430be43edf009836345ec4d9e1b9b3fa108 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 3 Jul 2026 23:32:08 +0200 Subject: [PATCH] cd2nroff: stricter checks for asterisks for italics The nroff (man page) version of the markdown docs could get asterisks mistreated as emphasis - seen in the CURLOPT_WRITEDATA manpage. The regex now more stricter requires a word character to follow an italics starting asterisk and there needs to be a word character or a closing parenthesis before the italics ending asterisk. Also: fix CURLINFO_CERTINFO.md which used wrong italics - it was not rendered correctly on GitHub and with other generic markdown parsers. Reported-by: Christian Ullrich Fixes #22257 Closes #22260 --- docs/libcurl/opts/CURLINFO_CERTINFO.md | 2 +- scripts/cd2nroff | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/libcurl/opts/CURLINFO_CERTINFO.md b/docs/libcurl/opts/CURLINFO_CERTINFO.md index 0882cbccd1..4d95ad7509 100644 --- a/docs/libcurl/opts/CURLINFO_CERTINFO.md +++ b/docs/libcurl/opts/CURLINFO_CERTINFO.md @@ -33,7 +33,7 @@ CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CERTINFO, # DESCRIPTION -Pass a pointer to a *struct curl_certinfo ** and it is set to point to a +Pass a pointer to a `struct curl_certinfo *` and it is set to point to a struct that holds info about the server's certificate chain, assuming you had CURLOPT_CERTINFO(3) enabled when the request was made. diff --git a/scripts/cd2nroff b/scripts/cd2nroff index 23fc4285cb..3f5a447929 100755 --- a/scripts/cd2nroff +++ b/scripts/cd2nroff @@ -421,7 +421,7 @@ sub single { # **bold** $d =~ s/\*\*(\S.*?)\*\*/\\fB$1\\fP/g; # *italics* - $d =~ s/\*(\S.*?)\*/\\fI$1\\fP/g; + $d =~ s/\*(\w.*?[\w)])\*/\\fI$1\\fP/g; my $back = $d;