Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F13783691
parse.go
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
407 B
Subscribers
None
parse.go
View Options
package
posts
import
(
"strings"
)
func
ExtractTitle
(
content
string
)
(
title
string
,
body
string
)
{
if
hashIndex
:=
strings
.
Index
(
content
,
"# "
);
hashIndex
==
0
{
eol
:=
strings
.
IndexRune
(
content
,
'\n'
)
// First line should start with # and end with \n
if
eol
!=
-
1
{
body
=
strings
.
TrimLeft
(
content
[
eol
:],
" \t\n\r"
)
title
=
content
[
len
(
"# "
):
eol
]
return
}
}
body
=
content
return
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 31, 11:35 AM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3612319
Attached To
rWC Write.as Web Core
Event Timeline
Log In to Comment