mirror of
https://github.com/go-shiori/shiori.git
synced 2025-12-09 05:25:53 +08:00
Convert template.HTML to string
This commit is contained in:
parent
8b31568eaf
commit
b16c5cc363
3 changed files with 14 additions and 18 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue