diff options
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -125,7 +125,7 @@ func populateFeed(feed *feeds.Feed, page []byte) (err error) { return fmt.Errorf("bad programme page") } - feed.Title = string(titleMatch[1]) + feed.Title = stripLink(string(titleMatch[1])) programImage := programImageRe.FindSubmatch(page) feed.Image = &feeds.Image{ Link: feed.Link.Href, @@ -255,3 +255,9 @@ func episodeID(url string) string { } return url } + +// stripLink strips string of <a> tags +func stripLink(s string) string { + re := regexp.MustCompile(`</?a.*?>`) + return re.ReplaceAllString(s, "") +} |