Skip to content

Commit

Permalink
generate HTTPS URLs for RFCs
Browse files Browse the repository at this point in the history
  • Loading branch information
vszakats authored and bagder committed Sep 28, 2023
1 parent 9d38074 commit b0bb14d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion roffit
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ sub linkfile {
$field =~ s/(^|\W)((https|http|ftp):\/\/[a-z0-9\-._~%:\/?\#\[\]\@!\$&'()*+,;=]+)/$1<a href=\"$2\">$2<\/a>/gi;

# convert (uppercase only) "RFC [number]" to a link
$field =~ s/(^|\W)RFC ?(\d+)/$1<a href=\"http:\/\/www.ietf.org\/rfc\/rfc$2.txt\">RFC $2<\/a>/g;
$field =~ s/(^|\W)RFC ?(\d+)/$1<a href=\"https:\/\/www.ietf.org\/rfc\/rfc$2.txt\">RFC $2<\/a>/g;

$processed .= $field . $tail;
}
Expand Down
4 changes: 2 additions & 2 deletions testpage.output
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<p class="level0">testpage - test input nroff man page for roffit testing </p><a name="SYNOPSIS"></a><h2 class="nroffsh">Synopsis</h2>
<p class="level0"><span Class="bold">roffit</span> [<span Class="emphasis">options</span>] &lt; inputfile &gt; outputfile </p><a name="DESCRIPTION"></a><h2 class="nroffsh">Description</h2>
<p class="level0"><span Class="bold">roffit</span> converts the <span Class="emphasis">inputfile</span> to <span Class="emphasis">outputfile</span>. The <span Class="emphasis">inputfile</span> must be an nroff formatted man page, and the <span Class="emphasis">outputfile</span> will be an HTML document. </p>
<p class="level0">(<a href="http://www.ietf.org/rfc/rfc959.txt">RFC 959</a>) is FTP </p>
<p class="level0">(<a href="https://www.ietf.org/rfc/rfc959.txt">RFC 959</a>) is FTP </p>
<p class="level0">but ARFC 959 is a fake </p>
<p class="level0"><a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a> is URI syntax </p>
<p class="level0"><a href="https://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a> is URI syntax </p>
<p class="level0">Also, we must support <span class="emphasis">style staring on one line and ending on another that may</span> be multiple lines off. </p><a name="OPTIONS"></a><h2 class="nroffsh">Options</h2>
<p class="level0"><a name="--bare"></a><span class="nroffip">--bare</span> </p>
<p class="level1">The output HTML will not include any HTML, HEAD or BODY tags. Also not that when this is selected, there will be no inlined CSS but you will have to define the necessary classes yourself. </p>
Expand Down

0 comments on commit b0bb14d

Please sign in to comment.