MCPcopy Index your code
hub / github.com/writefreely/writefreely / HasTag

Method HasTag

posts.go:289–295  ·  view source on GitHub ↗
(tag string)

Source from the content-addressed store, hash-verified

287}
288
289func (p *Post) HasTag(tag string) bool {
290 // Regexp looks for tag and has a non-capturing group at the end looking
291 // for the end of the word.
292 // Assisted by: https://stackoverflow.com/a/35192941/1549194
293 hasTag, _ := regexp.MatchString("#"+tag+`(?:[[:punct:]]|\s|\z)`, p.Content)
294 return hasTag
295}
296
297func (p *Post) HasTitleLink() bool {
298 if p.Title.String == "" {

Callers 1

showLocalTimelineFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected