aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/main.go b/main.go
index 2d71e4d..83a14ef 100644
--- a/main.go
+++ b/main.go
@@ -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, "")
+}