Skip to content

Commit 8781bcb

Browse files
vsemozhetbytMylesBorins
authored andcommitted
tools, doc: wrap manpage links in code elements
PR-URL: #20785 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 04f7678 commit 8781bcb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

test/doctool/test-doctool-html.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ const testData = [
5252
'<tr><td>v4.2.0</td><td><p>The <code>error</code> parameter can now be' +
5353
'an arrow function.</p></td></tr></table></details></div> ' +
5454
'<p>Describe <code>Foobar II</code> in more detail here.' +
55-
'<a href="http://man7.org/linux/man-pages/man1/fg.1.html">fg(1)</a></p>' +
56-
'<h2>Deprecated thingy<span><a class="mark" ' +
55+
'<a href="http://man7.org/linux/man-pages/man1/fg.1.html"><code>fg(1)' +
56+
'</code></a></p><h2>Deprecated thingy<span><a class="mark" ' +
5757
'href="#foo_deprecated_thingy" id="foo_deprecated_thingy">#</a>' +
5858
'</span></h2><div class="api_metadata"><span>Added in: v1.0.0</span>' +
5959
'<span>Deprecated since: v2.0.0</span></div><p>Describe ' +
6060
'<code>Deprecated thingy</code> in more detail here.' +
61-
'<a href="http://man7.org/linux/man-pages/man1/fg.1p.html">fg(1p)</a>' +
62-
'</p><h2>Something<span><a class="mark" href="#foo_something" ' +
63-
'id="foo_something">#</a></span></h2> ' +
61+
'<a href="http://man7.org/linux/man-pages/man1/fg.1p.html"><code>fg(1p)' +
62+
'</code></a></p><h2>Something<span><a class="mark" href="#foo_something' +
63+
'" id="foo_something">#</a></span></h2> ' +
6464
'<!-- This is not a metadata comment --> ' +
6565
'<p>Describe <code>Something</code> in more detail here. </p>'
6666
},

tools/doc/html.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function linkManPages(text) {
141141
MAN_PAGE, (match, beginning, name, number, optionalCharacter) => {
142142
// Name consists of lowercase letters,
143143
// number is a single digit with an optional lowercase letter.
144-
const displayAs = `${name}(${number}${optionalCharacter})`;
144+
const displayAs = `<code>${name}(${number}${optionalCharacter})</code>`;
145145

146146
if (BSD_ONLY_SYSCALLS.has(name)) {
147147
return `${beginning}<a href="https://www.freebsd.org/cgi/man.cgi` +

0 commit comments

Comments
 (0)