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
This commit is contained in:
Daniel Stenberg 2026-07-03 23:32:08 +02:00
parent d23fa6e4b6
commit b8ceb430be
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 2 additions and 2 deletions

View file

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

View file

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