From 97e935a1947291d6b422877906dbb75e22b05e2d Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Sat, 8 Jun 2019 17:02:44 -0700 Subject: some hacky regex url/img extraction stuff --- post/post.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'post') diff --git a/post/post.go b/post/post.go index 7fa7e90..5860eee 100644 --- a/post/post.go +++ b/post/post.go @@ -41,6 +41,8 @@ type Post struct { InFuture bool WordCount int Tags []string + Urls []string + Imgs []string // Content text -- raw, unprocessed, unfiltered markdown Text string @@ -220,6 +222,10 @@ func (p *Post) parse() { p.Tags = append(p.Tags, NormalizeTag(tag)) } } + + // Images and URLs + p.Urls = render.FindURLs(p.AbsoluteContent) + p.Imgs = render.FindImgs(p.AbsoluteContent) } /* -- cgit v1.2.3