mirror of
https://github.com/curl/curl.git
synced 2026-08-26 06:53:32 +03:00
docs: make curldown do angle brackets like markdown
Make sure we use \< and \> in markdown all over so that it renders correctly, on GitHub and elsewhere. cd2nroff now outputs a warning if it finds an unescaled angle bracket. Ref: #12854 Closes #12869
This commit is contained in:
parent
80944740e5
commit
d94733b447
26 changed files with 78 additions and 68 deletions
|
|
@ -243,11 +243,20 @@ sub single {
|
|||
next;
|
||||
}
|
||||
|
||||
# remove single line HTML comments
|
||||
$d =~ s/<!--.*?-->//g;
|
||||
|
||||
# **bold**
|
||||
$d =~ s/\*\*(\S.*?)\*\*/\\fB$1\\fP/g;
|
||||
# *italics*
|
||||
$d =~ s/\*(\S.*?)\*/\\fI$1\\fP/g;
|
||||
|
||||
if($d =~ /[^\\][\<\>]/) {
|
||||
print STDERR "$f:$line:1:WARN: un-escaped < or > used\n";
|
||||
}
|
||||
# convert backslash-'<' or '> to just the second character
|
||||
$d =~ s/\\([<<])/$1/g;
|
||||
|
||||
# mentions of curl symbols with man pages use italics by default
|
||||
$d =~ s/((lib|)curl([^ ]*\(3\)))/\\fI$1\\fP/gi;
|
||||
|
||||
|
|
@ -307,9 +316,6 @@ sub single {
|
|||
$blankline = 0;
|
||||
$header = 0;
|
||||
|
||||
# remove single line HTML comments
|
||||
$d =~ s/<!--.*?-->//g;
|
||||
|
||||
# quote minuses in the output
|
||||
$d =~ s/([^\\])-/$1\\-/g;
|
||||
# replace single quotes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue