MCPcopy
hub / github.com/writefreely/writefreely / isFontValid

Method isFontValid

posts.go:1363–1374  ·  view source on GitHub ↗

isFontValid returns whether or not the submitted post's appearance is valid.

()

Source from the content-addressed store, hash-verified

1361
1362// isFontValid returns whether or not the submitted post's appearance is valid.
1363func (p *SubmittedPost) isFontValid() bool {
1364 validFonts := map[string]bool{
1365 "norm": true,
1366 "sans": true,
1367 "mono": true,
1368 "wrap": true,
1369 "code": true,
1370 }
1371
1372 _, valid := validFonts[p.Font]
1373 return valid
1374}
1375
1376func getRawPost(app *App, friendlyID string) *RawPost {
1377 var content, font, title string

Callers 2

newPostFunction · 0.95
CreatePostMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected