File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -97,16 +97,20 @@ export const declarationSignatureToHtml = async (
9797 transformers : [
9898 {
9999 span ( node ) {
100- // Don't link from parameter names (e.g., don't link from `foo` in `foo: SomeType`).
100+ // Don't link from parameter names (e.g., don't link from `foo` in `(foo: Foo) => Bar`).
101+ // Valid only for `github-light` and `github-dark` themes.
101102 const style = String ( node . properties [ "style" ] ) . toLowerCase ( ) ;
102103 if ( style === "color:#e36209;--shiki-dark:#ffab70" ) return ;
103104
105+ // Skip empty spans; see https://github.com/syntax-tree/hast#element.
104106 const firstChild = node . children [ 0 ] ;
105107 if ( firstChild ?. type !== "text" ) return ;
106108
109+ // Don't link to this same declaration and don't link from reserved keywords.
107110 const text = firstChild . value ;
108111 if ( text === declaration . name || reservedKeywords . has ( text ) ) return ;
109112
113+ // Find a declaration to link to.
110114 const url = declarationUrl ( text ) ;
111115 if ( ! url ) return ;
112116
You can’t perform that action at this time.
0 commit comments