aboutsummaryrefslogtreecommitdiffstats
path: root/post
diff options
context:
space:
mode:
authorAdam Mathes <adam@trenchant.org>2019-06-08 17:02:44 -0700
committerAdam Mathes <adam@trenchant.org>2019-06-08 17:02:44 -0700
commit97e935a1947291d6b422877906dbb75e22b05e2d (patch)
tree8471a258673a123add31afa20a96a2b29541f5a6 /post
parenta5490ac27b5fe0d9f3404625844c82d3b6d3d612 (diff)
downloadsnkt-97e935a1947291d6b422877906dbb75e22b05e2d.tar.gz
snkt-97e935a1947291d6b422877906dbb75e22b05e2d.tar.bz2
snkt-97e935a1947291d6b422877906dbb75e22b05e2d.zip
some hacky regex url/img extraction stuff
Diffstat (limited to 'post')
-rw-r--r--post/post.go6
1 files changed, 6 insertions, 0 deletions
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)
}
/*