From 8684cea9b726d5bbe4aaceafffab3f3ccaf69f70 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Mon, 29 Aug 2016 20:15:45 -0700 Subject: [PATCH] doc/json: make sure links are correctly passed to marked 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 [buf.fill(fill, encoding)][buf.fill()]`). 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 buf.fill(fill, encoding)`. [1]: https://nodejs.org/api/buffer.json PR-URL: https://github.com/nodejs/node/pull/8494 Reviewed-By: Roman Reiss --- tools/doc/json.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/doc/json.js b/tools/doc/json.js index f5bce301056a48..a194c7f7231423 100644 --- a/tools/doc/json.js +++ b/tools/doc/json.js @@ -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'; } @@ -144,6 +145,7 @@ function doJSON(input, filename, cb) { } current.desc = current.desc || []; + current.desc.links = lexed.links; current.desc.push(tok); });