File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -691,6 +691,18 @@ describe("hosted thread links", () => {
691691 `[Review][thread]\n\n[thread]: ${ hosted } \n\nSee [Demo](t3-thread://v2/local/demo)` ,
692692 ) ;
693693
694+ for ( const markdown of [
695+ `[${ hosted } ][site]\n\n[site]: https://example.com` ,
696+ `![${ hosted } ][site]\n\n[site]: https://example.com` ,
697+ ] ) {
698+ expect ( relabelThreadLinks ( markdown , local , ( ) => "Demo" ) ) . toBe ( markdown ) ;
699+ expect ( threadLinkRefs ( markdown , local ) ) . toEqual ( [ ] ) ;
700+ }
701+ const labelWithLiveAfter = `[${ hosted } ][site]\n\n[site]: https://example.com\n\n${ hosted } ` ;
702+ expect ( relabelThreadLinks ( labelWithLiveAfter , local , ( ) => "Demo" ) ) . toBe (
703+ `[${ hosted } ][site]\n\n[site]: https://example.com\n\n[Demo](t3-thread://v2/local/demo)` ,
704+ ) ;
705+
694706 const paragraphContinuation = `Intro\n[thread]: ${ hosted } ` ;
695707 expect ( relabelThreadLinks ( paragraphContinuation , local , ( ) => "Demo" ) ) . toBe (
696708 `Intro\n[thread]: [Demo](t3-thread://v2/local/demo)` ,
Original file line number Diff line number Diff line change @@ -403,7 +403,13 @@ function parsedLinkSource(markdown: string) {
403403 const node = pending . pop ( ) ! ;
404404 const start = node . position ?. start . offset ;
405405 const end = node . position ?. end . offset ;
406- if ( node . type === "code" || node . type === "inlineCode" || node . type === "definition" ) {
406+ if (
407+ node . type === "code" ||
408+ node . type === "inlineCode" ||
409+ node . type === "definition" ||
410+ node . type === "linkReference" ||
411+ node . type === "imageReference"
412+ ) {
407413 if ( start !== undefined && end !== undefined ) skippedRanges ?. push ( { start, end } ) ;
408414 continue ;
409415 }
You can’t perform that action at this time.
0 commit comments