Skip to content

Commit 5d8d450

Browse files
fix: @see tags incorrectly formatted in markdown ouput fixed #1337
1 parent 2d9f28a commit 5d8d450

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

__tests__/__snapshots__/test.js.snap

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27337,8 +27337,8 @@ exports[`outputs meta.input.js markdown 1`] = `
2733727337

2733827338
## meta.input
2733927339

27340-
- **See: [markdown link][2]
27341-
**
27340+
- **See**: [markdown link][2]
27341+
2734227342

2734327343
This function returns the number one.
2734427344

@@ -27383,9 +27383,18 @@ Object {
2738327383
"children": Array [
2738427384
Object {
2738527385
"children": Array [
27386+
Object {
27387+
"children": Array [
27388+
Object {
27389+
"type": "text",
27390+
"value": "See",
27391+
},
27392+
],
27393+
"type": "strong",
27394+
},
2738627395
Object {
2738727396
"type": "text",
27388-
"value": "See: ",
27397+
"value": ": ",
2738927398
},
2739027399
Object {
2739127400
"children": Array [
@@ -27447,7 +27456,7 @@ Object {
2744727456
"type": "root",
2744827457
},
2744927458
],
27450-
"type": "strong",
27459+
"type": "paragraph",
2745127460
},
2745227461
],
2745327462
"type": "listItem",

src/output/markdown_ast.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,15 +223,20 @@ function buildMarkdownAST(comments, config) {
223223
);
224224
}
225225

226-
function seeLink(comment) {
226+
function seeLink({ sees = [] }) {
227227
return (
228-
comment.sees.length > 0 &&
228+
sees.length > 0 &&
229229
u(
230230
'list',
231231
{ ordered: false },
232-
comment.sees.map(see =>
232+
sees.map(see =>
233233
u('listItem', [
234-
u('strong', [u('text', 'See: ')].concat(see.description))
234+
u(
235+
'paragraph',
236+
[u('strong', [u('text', 'See')]), u('text', ': ')].concat(
237+
see.description
238+
)
239+
)
235240
])
236241
)
237242
)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy