mirror of
https://github.com/eiblog/eiblog.git
synced 2026-03-01 00:34:58 +08:00
fix unuse tag <!--more-->
intercept errors
This commit is contained in:
4
db.go
4
db.go
@@ -221,8 +221,8 @@ func generateTopic() {
|
|||||||
Author: setting.Conf.Account.Username,
|
Author: setting.Conf.Account.Username,
|
||||||
Title: "友情链接",
|
Title: "友情链接",
|
||||||
Slug: "blogroll",
|
Slug: "blogroll",
|
||||||
UpdateTime: time.Now(),
|
CreateTime: time.Now(),
|
||||||
CreateTime: time.Time{},
|
UpdateTime: time.Time{},
|
||||||
}
|
}
|
||||||
err := db.Insert(DB, COLLECTION_ARTICLE, blogroll)
|
err := db.Insert(DB, COLLECTION_ARTICLE, blogroll)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -70,12 +70,12 @@ func ReadDir(dir string, filter func(name string) bool) (files []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func IgnoreHtmlTag(src string) string {
|
func IgnoreHtmlTag(src string) string {
|
||||||
//去除所有尖括号内的HTML代码
|
// 去除所有尖括号内的HTML代码
|
||||||
re, _ := regexp.Compile("\\<[\\S\\s]+?\\>")
|
re, _ := regexp.Compile(`<[\S\s]+?>`)
|
||||||
src = re.ReplaceAllString(src, "")
|
src = re.ReplaceAllString(src, "")
|
||||||
|
|
||||||
//去除换行符
|
// 去除换行符
|
||||||
re, _ = regexp.Compile("\\s{2,}")
|
re, _ = regexp.Compile(`\s+`)
|
||||||
return re.ReplaceAllString(src, "")
|
return re.ReplaceAllString(src, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user