Skip to content

Commit

Permalink
fix(core): escape symbols signatures correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
tgreyuk committed May 6, 2024
1 parent 5afbeeb commit bbf4d10
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 50 deletions.
26 changes: 13 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ export function escapeChars(str: string) {
.replace(/_/g, '\\_')
.replace(/`/g, '\\`')
.replace(/\|/g, '\\|')
.replace(/\[/g, '\\[')
.replace(/\]/g, '\\]')
.replace(/\*/g, '\\*');
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ export class DerivedClassB extends AbstractClass {
}
}

const symbolConst: unique symbol = Symbol('SomeSymbol');

export class ClassWithSymbols {
[Symbol.dispose]() {}
public static [symbolConst]?: () => void;
}

export class DisposableClass implements Disposable {
[Symbol.dispose]() {}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2730,6 +2730,11 @@ exports[`Navigation should gets Navigation Json for single entry point: (Output
"kind": 128,
"path": "classes/ClassWithSimpleProps.md"
},
{
"title": "ClassWithSymbols",
"kind": 128,
"path": "classes/ClassWithSymbols.md"
},
{
"title": "ClassWithTypeParameters",
"kind": 128,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -763,9 +763,9 @@ Comments variable with symbol
## Type declaration
### [sym]
### \\[sym\\]
> **[sym]**: \`string\` = \`'value'\`
> **\\[sym\\]**: \`string\` = \`'value'\`
Comments for symbol
"
Expand All @@ -784,7 +784,7 @@ Comments variable with symbol
## Type declaration
### [sym]
### \\[sym\\]
\`\`\`ts
[sym]: string = 'value';
Expand Down

0 comments on commit bbf4d10

Please sign in to comment.