Skip to content

Commit

Permalink
hackernews: support "noreferrer" on anchor link
Browse files Browse the repository at this point in the history
  • Loading branch information
azimut committed Jul 5, 2023
1 parent 73d1a6c commit 2133901
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/hackernews/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ func (c Comment) String() (ret string) {
return
}

var reAnchor = regexp.MustCompile(`<a href="([^"]+)"( rel="nofollow")?>([^<]+)</a>`)
var reAnchor = regexp.MustCompile(
`<a href="([^"]+)"(( rel="nofollow")|( rel="nofollow noreferrer"))?>([^<]+)</a>`,
)
var reItalic = regexp.MustCompile(`<i>([^<]+)</i>`)

var italicStyle = lipgloss.NewStyle().Italic(true)
Expand Down

0 comments on commit 2133901

Please sign in to comment.