11import  { matchEmoji ,  matchMention ,  matchIssue }  from  '../../utils/match.ts' ; 
22import  { emojiString }  from  '../emoji.ts' ; 
33import  { svg }  from  '../../svg.ts' ; 
4+ import  { parseIssueHref }  from  '../../utils.ts' ; 
45
5- type  Issue  =  { id : string ;  title : string ;  state : 'open'  |  'closed' ;  pull_request ?: { draft : boolean ;  merged : boolean } } ; 
6+ type  Issue  =  { id : number ;  title : string ;  state : 'open'  |  'closed' ;  pull_request ?: { draft : boolean ;  merged : boolean } } ; 
67function  getIssueIcon ( issue : Issue )  { 
78  if  ( issue . pull_request )  { 
89    if  ( issue . state  ===  'open' )  { 
@@ -84,8 +85,8 @@ export function initTextExpander(expander) {
8485      provide ( { matched : true ,  fragment : ul } ) ; 
8586    }  else  if  ( key  ===  '#' )  { 
8687      provide ( new  Promise ( async  ( resolve )  =>  { 
87-         const  url   =   window . location . href ; 
88-         const  matches  =  await  matchIssue ( url ,  text ) ; 
88+         const  { owner ,  repo ,  index }   =   parseIssueHref ( window . location . href ) ; 
89+         const  matches  =  await  matchIssue ( owner ,   repo ,   index ,  text ) ; 
8990        if  ( ! matches . length )  return  resolve ( { matched : false } ) ; 
9091
9192        const  ul  =  document . createElement ( 'ul' ) ; 
@@ -102,7 +103,7 @@ export function initTextExpander(expander) {
102103
103104          const  id  =  document . createElement ( 'span' ) ; 
104105          id . classList . add ( 'id' ) ; 
105-           id . textContent  =  issue . id ; 
106+           id . textContent  =  issue . id . toString ( ) ; 
106107          li . append ( id ) ; 
107108
108109          const  nameSpan  =  document . createElement ( 'span' ) ; 
0 commit comments