Skip to content

Commit

Permalink
doc/json: make sure links are correctly passed to marked
Browse files Browse the repository at this point in the history
Previously, an attempt was made to make sure the links state is
inherited. Unfortunately, this support was not complete, which
results in various unresolved links in the JSON output (as an
example, [1] contains `initialized by calling
[<code>buf.fill(fill, encoding)</code>][<code>buf.fill()</code>]`).

This commit completes that attempt. After this commit, individual
instances of the parser (for descriptions) inherit the links state
from the root lexer, so that individual Markdown links in descriptions
could be resolved. That same example is now substituted with
`initialized by calling <a href=\"#buffer_buf_fill_value_offset_end_encoding\"><code>buf.fill(fill, encoding)</code></a>`.

[1]: https://nodejs.org/api/buffer.json

PR-URL: #8494
Reviewed-By: Roman Reiss <me@silverwind.io>
  • Loading branch information
TimothyGu authored and Fishrock123 committed Oct 11, 2016
1 parent 8c91a9b commit 8684cea
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/doc/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ function doJSON(input, filename, cb) {
current.shortDesc = current.desc;
current.desc = [];
}
current.desc.links = lexed.links;
current.desc.push(tok);
state = 'DESC';
}
Expand Down Expand Up @@ -144,6 +145,7 @@ function doJSON(input, filename, cb) {
}

current.desc = current.desc || [];
current.desc.links = lexed.links;
current.desc.push(tok);

});
Expand Down

1 comment on commit 8684cea

@Fishrock123
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Landed with an incorrect subsystem, should have been tools:

Please sign in to comment.