@@ -160,6 +160,17 @@ func (i Issue) fragments() []fragment {
160160 )
161161 }
162162
163+ if len (i .Data .Fields .RemoteLinks ) > 0 {
164+ scraps = append (
165+ scraps ,
166+ newBlankFragment (1 ),
167+ fragment {Body : i .separator ("External Links" )},
168+ newBlankFragment (2 ),
169+ fragment {Body : i .remoteLinks ()},
170+ newBlankFragment (1 ),
171+ )
172+ }
173+
163174 if i .Data .Fields .Comment .Total > 0 && i .Options .NumComments > 0 {
164175 scraps = append (
165176 scraps ,
@@ -378,6 +389,40 @@ func (i Issue) linkedIssues() string {
378389 return linked .String ()
379390}
380391
392+ func (i Issue ) remoteLinks () string {
393+ if len (i .Data .Fields .RemoteLinks ) == 0 {
394+ return ""
395+ }
396+
397+ var (
398+ remote strings.Builder
399+ maxTitleLen int
400+ summaryLen = defaultSummaryLength
401+ )
402+
403+ // Calculate max lengths for formatting
404+ for _ , link := range i .Data .Fields .RemoteLinks {
405+ maxTitleLen = max (len (link .Object .Title ), maxTitleLen )
406+ }
407+
408+ if maxTitleLen < summaryLen {
409+ summaryLen = maxTitleLen
410+ }
411+
412+ remote .WriteString ("\n " )
413+ for _ , link := range i .Data .Fields .RemoteLinks {
414+ remote .WriteString (
415+ fmt .Sprintf (
416+ " %s\n %s\n \n " ,
417+ coloredOut (shortenAndPad (link .Object .Title , summaryLen ), color .FgCyan , color .Bold ),
418+ coloredOut (link .Object .URL , color .FgBlue , color .Underline ),
419+ ),
420+ )
421+ }
422+
423+ return remote .String ()
424+ }
425+
381426func (i Issue ) comments () []issueComment {
382427 total := i .Data .Fields .Comment .Total
383428 comments := make ([]issueComment , 0 , total )
0 commit comments