Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor token parsers slightly, add {Array} in table header
  • Loading branch information
silverwind committed Apr 12, 2017
commit 3a1292de7d04fb6ab41a25bb2c25763732b00560
2 changes: 1 addition & 1 deletion doc/api/dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ added: v0.1.27
Uses the DNS protocol to resolve a hostname (e.g. `'nodejs.org'`) into an
array of the resource records, specified by `rrtype` (resource record type):

| `rrtype` | Return array contains | Result type | Shorthand method |
| `rrtype` | Return {Array} contains | Result type | Shorthand method |
|-----------|--------------------------------|-------------|--------------------------|
| `'A'` | IPv4 addresses (default) | {string} | [`dns.resolve4()`][] |
| `'AAAA'` | IPv6 addresses | {string} | [`dns.resolve6()`][] |
Expand Down
34 changes: 17 additions & 17 deletions tools/doc/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,26 +192,26 @@ function replaceInText(text) {
// for example, link man page references to the actual page
function parseText(lexed) {
lexed.forEach(function(tok) {
if (tok.text && tok.type !== 'code') {
tok.text = replaceInText(tok.text);
}
if (tok.type === 'table') {
if (tok.cells) {
tok.cells.forEach((row, x) => {
row.forEach((_, y) => {
if (tok.cells[x] && tok.cells[x][y]) {
tok.cells[x][y] = replaceInText(tok.cells[x][y]);
}
});
});
}

if (tok.cells) {
tok.cells.forEach((row, x) => {
row.forEach((_, y) => {
if (tok.cells[x] && tok.cells[x][y]) {
tok.cells[x][y] = replaceInText(tok.cells[x][y]);
if (tok.header) {
tok.header.forEach((_, i) => {
if (tok.header[i]) {
tok.header[i] = replaceInText(tok.header[i]);
}
});
});
}

if (tok.header) {
tok.headers.forEach((_, i) => {
if (tok.headers[i]) {
tok.headers[i] = replaceInText(tok.headers[i]);
}
});
}
} else if (tok.text && tok.type !== 'code') {
tok.text = replaceInText(tok.text);
}
});
}
Expand Down