Skip to content

Commit

Permalink
fix(core): remove superfluous spaces and symbol on external links (#614)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgreyuk committed May 11, 2024
1 parent 569eb47 commit 8962a9f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 25 deletions.
3 changes: 2 additions & 1 deletion .changeset/young-wombats-applaud.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
"typedoc-plugin-markdown": patch
'typedoc-plugin-markdown': patch
---

- Remove superfluous spaces and symbol on external links (#614)
- Escape all angle brackets with "santizeComments" (#612)
- Correctly handle quoted symbol names (#611)
- Correctly handle excludeScopesInPaths in windows (#610)
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function referenceType(
} else {
reflection.push(
model.externalUrl
? `[${backTicks(model.name + ' ↗️')}]( ${model.externalUrl} )`
? link(backTicks(model.name), model.externalUrl)
: backTicks(model.name),
);
}
Expand All @@ -32,6 +32,6 @@ export function referenceType(
return reflection.join('');
}
return model.externalUrl
? `[${backTicks(model.name + ' ↗️')}]( ${model.externalUrl} )`
? link(backTicks(model.name), model.externalUrl)
: backTicks(model.name);
}
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,13 @@ Comments for BasicInterface
exports[`Objects And Params should compile function returning a promise: (Output File Strategy "members") (Option Group "1") 1`] = `
"# Function: functionReturningAPromise()
> **functionReturningAPromise**(): [\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\\{\`"prop"\`: \`string\`; \\}\\>
> **functionReturningAPromise**(): [\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\\{\`"prop"\`: \`string\`; \\}\\>
Comments for function
## Returns
[\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\\{\`"prop"\`: \`string\`; \\}\\>
[\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\\{\`"prop"\`: \`string\`; \\}\\>
Return comments
Expand All @@ -257,7 +257,7 @@ Comments for function
## Returns
[\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\\{
[\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\\{
\`"prop"\`: \`string\`;
\\}\\>
Expand Down Expand Up @@ -500,7 +500,7 @@ bar: number;
exports[`Objects And Params should compile literal type: (Output File Strategy "members") (Option Group "1") 1`] = `
"# Type alias: LiteralType
> **LiteralType**: \\{\`"x"\`: \`string\`;\`"y"\`: \\{\`"x"\`: \`string\`;\`"y"\`: \`boolean\` \\| \`string\`;\`"z"\`: (\`x\`: \`string\`) => \`string\`; \\};\`"z"\`: (\`x\`: \`string\`) => \`string\`;get set \`"accessorA"\`: [\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\`string\`\\>;get set \`"accessorB"\`: \`string\`;\`"someFunction"\`: [\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\`any\`\\>; \\}
> **LiteralType**: \\{\`"x"\`: \`string\`;\`"y"\`: \\{\`"x"\`: \`string\`;\`"y"\`: \`boolean\` \\| \`string\`;\`"z"\`: (\`x\`: \`string\`) => \`string\`; \\};\`"z"\`: (\`x\`: \`string\`) => \`string\`;get set \`"accessorA"\`: [\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\`string\`\\>;get set \`"accessorB"\`: \`string\`;\`"someFunction"\`: [\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\`any\`\\>; \\}
Comments for LiteralType
Expand Down Expand Up @@ -558,21 +558,21 @@ comment for y.z
### accessorA
> \`get\` **accessorA**(): [\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\`string\`\\>
> \`get\` **accessorA**(): [\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\`string\`\\>
Comments for accessorA getter
> \`set\` **accessorA**(\`x\`: [\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\`string\`\\>): \`void\`
> \`set\` **accessorA**(\`x\`: [\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\`string\`\\>): \`void\`
Comments for accessorA setter
#### Parameters
• **x**: [\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\`string\`\\>
• **x**: [\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\`string\`\\>
#### Returns
[\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\`string\`\\>
[\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\`string\`\\>
### accessorB
Expand All @@ -598,7 +598,7 @@ Comments for someFunction
#### Returns
[\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\`any\`\\>
[\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\`any\`\\>
"
`;
Expand Down Expand Up @@ -712,11 +712,11 @@ Comments for accessorA setter
| Parameter | Type |
| :------ | :------ |
| \`x\` | [\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\`string\`\\> |
| \`x\` | [\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\`string\`\\> |
#### Returns
[\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\`string\`\\>
[\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\`string\`\\>
### accessorB
Expand Down Expand Up @@ -750,7 +750,7 @@ Comments for someFunction
#### Returns
[\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\`any\`\\>
[\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\`any\`\\>
"
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ Comments for function
exports[`Function Reflection should compile function returning a promise: (Output File Strategy "members") (Option Group "1") 1`] = `
"# Function: functionReturningAPromise()
> **functionReturningAPromise**(): [\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\`object\`\\>
> **functionReturningAPromise**(): [\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\`object\`\\>
Comments for function
## Returns
[\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\`object\`\\>
[\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\`object\`\\>
Return comments
Expand All @@ -98,7 +98,7 @@ Comments for function
## Returns
[\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\`object\`\\>
[\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\`object\`\\>
Return comments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Comments for ConditionalType
exports[`Type Alias Reflection should compile external link symbol type: (Output File Strategy "members") (Option Group "1") 1`] = `
"# Type alias: TypeWithExternalSymbolLinkMapping
> **TypeWithExternalSymbolLinkMapping**: [\`Application ↗️\`]( https://typedoc.org/api/classes/Application.html )
> **TypeWithExternalSymbolLinkMapping**: [\`Application\`](https://typedoc.org/api/classes/Application.html)
Comments for TypeWithExternalSymbolLinkMapping
Expand Down Expand Up @@ -155,7 +155,7 @@ comment for y.z
### accessorA
> \`get\` **accessorA**(): [\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\`string\`\\>
> \`get\` **accessorA**(): [\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\`string\`\\>
Comments for accessorA getter
Expand All @@ -165,11 +165,11 @@ Comments for accessorA setter
#### Parameters
• **x**: [\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\`string\`\\>
• **x**: [\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\`string\`\\>
#### Returns
[\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\`string\`\\>
[\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\`string\`\\>
### accessorB
Expand All @@ -195,7 +195,7 @@ Comments for someFunction
#### Returns
[\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\`any\`\\>
[\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\`any\`\\>
## Source
Expand All @@ -222,11 +222,11 @@ Comments for LiteralType
| \`y.y\` | \`boolean\` \\| \`string\` | comment for y.y |
| \`y.z\` | (\`x\`: \`string\`) => \`string\` | comment for y.z |
| \`z\` | (\`x\`: \`string\`) => \`string\` | - |
| \`get accessorA\` | [\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\`string\`\\> | Comments for accessorA getter |
| \`get accessorA\` | [\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\`string\`\\> | Comments for accessorA getter |
| \`set accessorA\` | \`void\` | Comments for accessorA setter |
| \`get accessorB\` | \`string\` | - |
| \`set accessorB\` | \`void\` | - |
| \`someFunction\` | [\`Promise ↗️\`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )\\<\`any\`\\> | Comments for someFunction |
| \`someFunction\` | [\`Promise\`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\\<\`any\`\\> | Comments for someFunction |
## Source
Expand Down

0 comments on commit 8962a9f

Please sign in to comment.