We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f29da5 commit 4630412Copy full SHA for 4630412
posts/parse.go
@@ -4,6 +4,8 @@ import (
4
"strings"
5
)
6
7
+// ExtractTitle takes the given raw post text and returns a title, if explicitly
8
+// provided, and a body.
9
func ExtractTitle(content string) (title string, body string) {
10
if hashIndex := strings.Index(content, "# "); hashIndex == 0 {
11
eol := strings.IndexRune(content, '\n')
0 commit comments