Skip to content

Commit 4630412

Browse files
committed
Document posts.ExtractTitle func
1 parent 1f29da5 commit 4630412

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

posts/parse.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import (
44
"strings"
55
)
66

7+
// ExtractTitle takes the given raw post text and returns a title, if explicitly
8+
// provided, and a body.
79
func ExtractTitle(content string) (title string, body string) {
810
if hashIndex := strings.Index(content, "# "); hashIndex == 0 {
911
eol := strings.IndexRune(content, '\n')

0 commit comments

Comments
 (0)