(tag string)
| 287 | } |
| 288 | |
| 289 | func (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 | |
| 297 | func (p *Post) HasTitleLink() bool { |
| 298 | if p.Title.String == "" { |