Skip to content

Commit e8aa558

Browse files
TimothyGuMyles Borins
authored and
Myles Borins
committed
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 [<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 <[email protected]>
1 parent ec99640 commit e8aa558

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/doc/json.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ function doJSON(input, filename, cb) {
109109
current.shortDesc = current.desc;
110110
current.desc = [];
111111
}
112+
current.desc.links = lexed.links;
112113
current.desc.push(tok);
113114
state = 'DESC';
114115
}
@@ -144,6 +145,7 @@ function doJSON(input, filename, cb) {
144145
}
145146

146147
current.desc = current.desc || [];
148+
current.desc.links = lexed.links;
147149
current.desc.push(tok);
148150

149151
});

0 commit comments

Comments
 (0)