@@ -16,6 +16,7 @@ import {
1616 QueryType ,
1717 ReferenceReflection ,
1818 ReflectionKind ,
19+ ReflectionSymbolId ,
1920 ReflectionType ,
2021 SignatureReflection ,
2122 UnionType ,
@@ -1732,4 +1733,51 @@ describe("Issue Tests", () => {
17321733 [ undefined , "2" , '"counterclockwise"' ] ,
17331734 ) ;
17341735 } ) ;
1736+
1737+ it ( "#2700a correctly parses links to global properties" , ( ) => {
1738+ const project = convert ( ) ;
1739+ app . options . setValue ( "validation" , {
1740+ invalidLink : true ,
1741+ notDocumented : false ,
1742+ notExported : false ,
1743+ } ) ;
1744+
1745+ app . validate ( project ) ;
1746+ logger . expectMessage (
1747+ 'warn: Failed to resolve link to "Map.size | size user specified" in comment for abc' ,
1748+ ) ;
1749+ logger . expectMessage (
1750+ 'warn: Failed to resolve link to "Map.size user specified" in comment for abc' ,
1751+ ) ;
1752+ logger . expectMessage (
1753+ 'warn: Failed to resolve link to "Map.size" in comment for abc' ,
1754+ ) ;
1755+
1756+ const abc = query ( project , "abc" ) ;
1757+ const link = abc . comment ?. summary . find ( ( c ) => c . kind === "inline-tag" ) ;
1758+ ok ( link ?. target instanceof ReflectionSymbolId ) ;
1759+ } ) ;
1760+
1761+ it ( "#2700b respects user specified link text when resolving external links" , ( ) => {
1762+ const project = convert ( ) ;
1763+
1764+ const abc = query ( project , "abc" ) ;
1765+ ok ( abc . comment ) ;
1766+
1767+ const resolvers = app . converter [ "_externalSymbolResolvers" ] . slice ( ) ;
1768+ app . converter . addUnknownSymbolResolver ( ( ) => {
1769+ return {
1770+ target : "https://typedoc.org" ,
1771+ caption : "resolver caption" ,
1772+ } ;
1773+ } ) ;
1774+ app . converter . resolveLinks ( abc . comment , abc ) ;
1775+ app . converter [ "_externalSymbolResolvers" ] = resolvers ;
1776+
1777+ equal ( getLinks ( abc ) , [
1778+ { display : "size user specified" , target : "https://typedoc.org" } ,
1779+ { display : "user specified" , target : "https://typedoc.org" } ,
1780+ { display : "resolver caption" , target : "https://typedoc.org" } ,
1781+ ] ) ;
1782+ } ) ;
17351783} ) ;
0 commit comments