Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F10472702
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, Feb 22, 6:54 AM (15 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3155497
Attached To
rWCLI writeas-cli
Event Timeline
Log In to Comment