diff --git a/cmd/add.go b/cmd/add.go index 0497b17e..9e004fdd 100644 --- a/cmd/add.go +++ b/cmd/add.go @@ -1,7 +1,6 @@ package cmd import ( - "html/template" nurl "net/url" "strings" "time" @@ -81,7 +80,7 @@ func addBookmark(base model.Bookmark, offline bool) (book model.Bookmark, err er book.MinReadTime = article.Meta.MinReadTime book.MaxReadTime = article.Meta.MaxReadTime book.Content = article.Content - book.HTML = template.HTML(article.RawContent) + book.HTML = article.RawContent if book.Title == "" { book.Title = article.Meta.Title diff --git a/cmd/update.go b/cmd/update.go index 75baba74..9d47bbb9 100644 --- a/cmd/update.go +++ b/cmd/update.go @@ -2,7 +2,6 @@ package cmd import ( "fmt" - "html/template" "strconv" "strings" "sync" @@ -121,7 +120,7 @@ func updateBookmarks(indices []string, url, title, excerpt string, tags []string book.MinReadTime = article.Meta.MinReadTime book.MaxReadTime = article.Meta.MaxReadTime book.Content = article.Content - book.HTML = template.HTML(article.RawContent) + book.HTML = article.RawContent mutex.Lock() bookmarks[pos] = book diff --git a/model/model.go b/model/model.go index 4a7954a1..f6d2a8eb 100644 --- a/model/model.go +++ b/model/model.go @@ -1,7 +1,5 @@ package model -import "html/template" - // Tag is tag for the bookmark type Tag struct { ID int64 `db:"id" json:"id"` @@ -11,18 +9,18 @@ type Tag struct { // Bookmark is record of a specified URL type Bookmark struct { - ID int64 `db:"id" json:"id"` - URL string `db:"url" json:"url"` - Title string `db:"title" json:"title"` - ImageURL string `db:"image_url" json:"imageURL"` - Excerpt string `db:"excerpt" json:"excerpt"` - Author string `db:"author" json:"author"` - MinReadTime int `db:"min_read_time" json:"minReadTime"` - MaxReadTime int `db:"max_read_time" json:"maxReadTime"` - Modified string `db:"modified" json:"modified"` - Content string `db:"content" json:"-"` - HTML template.HTML `db:"html" json:"-"` - Tags []Tag `json:"tags"` + ID int64 `db:"id" json:"id"` + URL string `db:"url" json:"url"` + Title string `db:"title" json:"title"` + ImageURL string `db:"image_url" json:"imageURL"` + Excerpt string `db:"excerpt" json:"excerpt"` + Author string `db:"author" json:"author"` + MinReadTime int `db:"min_read_time" json:"minReadTime"` + MaxReadTime int `db:"max_read_time" json:"maxReadTime"` + Modified string `db:"modified" json:"modified"` + Content string `db:"content" json:"-"` + HTML string `db:"html" json:"-"` + Tags []Tag `json:"tags"` } // Account is account for accessing bookmarks from web interface