diff --git a/moment/moment.go b/moment/moment.go index 1cac73a..e7f8d3b 100644 --- a/moment/moment.go +++ b/moment/moment.go @@ -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 { diff --git a/web/moment_cache.go b/web/moment_cache.go index 94efe4f..2217583 100644 --- a/web/moment_cache.go +++ b/web/moment_cache.go @@ -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]+)="([^"]*)"`) @@ -98,7 +98,7 @@ func (cache *momentCache) compile(m *moment.Moment) *momentCacheEntry { text = v } return fmt.Sprintf(`%s`, 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)