fix: @see tags incorrectly formatted in markdown ouput fixed #1337

This commit is contained in:
Anton Shchekota 2021-04-07 15:28:32 +03:00 committed by Anton
parent 2d9f28a48b
commit 5d8d4504d5
2 changed files with 22 additions and 8 deletions

View File

@ -27337,8 +27337,8 @@ exports[`outputs meta.input.js markdown 1`] = `
## meta.input
- **See: [markdown link][2]
**
- **See**: [markdown link][2]
This function returns the number one.
@ -27383,9 +27383,18 @@ Object {
"children": Array [
Object {
"children": Array [
Object {
"children": Array [
Object {
"type": "text",
"value": "See",
},
],
"type": "strong",
},
Object {
"type": "text",
"value": "See: ",
"value": ": ",
},
Object {
"children": Array [
@ -27447,7 +27456,7 @@ Object {
"type": "root",
},
],
"type": "strong",
"type": "paragraph",
},
],
"type": "listItem",

View File

@ -223,15 +223,20 @@ function buildMarkdownAST(comments, config) {
);
}
function seeLink(comment) {
function seeLink({ sees = [] }) {
return (
comment.sees.length > 0 &&
sees.length > 0 &&
u(
'list',
{ ordered: false },
comment.sees.map(see =>
sees.map(see =>
u('listItem', [
u('strong', [u('text', 'See: ')].concat(see.description))
u(
'paragraph',
[u('strong', [u('text', 'See')]), u('text', ': ')].concat(
see.description
)
)
])
)
)