Skip to content

Commit

Permalink
fix: @see tags incorrectly formatted in markdown ouput fixed #1337
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony-redFox committed Apr 15, 2021
1 parent 2d9f28a commit 5d8d450
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
17 changes: 13 additions & 4 deletions __tests__/__snapshots__/test.js.snap
Expand Up @@ -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.

Expand Down Expand Up @@ -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 [
Expand Down Expand Up @@ -27447,7 +27456,7 @@ Object {
"type": "root",
},
],
"type": "strong",
"type": "paragraph",
},
],
"type": "listItem",
Expand Down
13 changes: 9 additions & 4 deletions src/output/markdown_ast.js
Expand Up @@ -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
)
)
])
)
)
Expand Down

0 comments on commit 5d8d450

Please sign in to comment.