Skip to content

Commit

Permalink
add author to Moment
Browse files Browse the repository at this point in the history
  • Loading branch information
ledyba committed May 2, 2018
1 parent 12cdff4 commit e7edaf3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions moment/moment.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
)

type Moment struct {
Date time.Time `yaml:"date"`
Title string `yaml:"title"`
Text string `yaml:"text"`
Date time.Time `yaml:"date"`
Title string `yaml:"title"`
Text string `yaml:"text"`
Author string `yaml:"author"`
}

func (m *Moment) Path() string {
Expand Down
4 changes: 2 additions & 2 deletions web/moment_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type momentCacheEntry struct {
}

var (
embedRegex = regexp.MustCompile(`\[(link|img|video|audio) ([^\]]+)\]`)
embedRegex = regexp.MustCompile(`\[(link|image|video|audio) ([^\]]+)\]`)
paragraphRegex = regexp.MustCompile(`(?ms)(^|\n+|>\n)(.+?)($|\n\n+|\n<)`)
blockRegex = regexp.MustCompile(`<(script|div|pre|hr|ol|ul|video|blockquote|canvas) `)
keyValueRegex = regexp.MustCompile(`([a-z]+)="([^"]*)"`)
Expand Down Expand Up @@ -98,7 +98,7 @@ func (cache *momentCache) compile(m *moment.Moment) *momentCacheEntry {
text = v
}
return fmt.Sprintf(`<a href="%s">%s</a>`, url, text)
case "img":
case "image":
if img, ok := e.(*entity.ImageEntity); ok {
c.embedding = append(c.embedding, e)
src := fmt.Sprintf("/entity/%s", id)
Expand Down

0 comments on commit e7edaf3

Please sign in to comment.