From 46304124ec6d59daf691877182fa8040508f0cea Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Thu, 30 May 2019 10:12:34 -0400 Subject: [PATCH] Document posts.ExtractTitle func --- posts/parse.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/posts/parse.go b/posts/parse.go index 85d0c4d..b082a05 100644 --- a/posts/parse.go +++ b/posts/parse.go @@ -4,6 +4,8 @@ import ( "strings" ) +// ExtractTitle takes the given raw post text and returns a title, if explicitly +// provided, and a body. func ExtractTitle(content string) (title string, body string) { if hashIndex := strings.Index(content, "# "); hashIndex == 0 { eol := strings.IndexRune(content, '\n')