mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-04 13:52:26 +08:00
fix: title in xml not escape
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>{{.Title}}</title>
|
||||
<title>{{xmlescape .Title}}</title>
|
||||
<link>https://{{.Host}}</link>
|
||||
<description>{{.SubTitle}}</description>
|
||||
<description>{{xmlescape .SubTitle}}</description>
|
||||
<atom:link href="https://{{.Host}}/rss.html" rel="self" />
|
||||
<atom:link href="{{.FeedrURL}}" rel="hub" />
|
||||
<language>zh-CN</language>
|
||||
<lastBuildDate>{{.BuildDate}}</lastBuildDate>
|
||||
{{range .Articles}}
|
||||
<item>
|
||||
<title>{{.Title}}</title>
|
||||
<title>{{xmlescape .Title}}</title>
|
||||
<link>https://{{$.Host}}/post/{{.Slug}}.html</link>
|
||||
<comments>https://{{$.Host}}/post/{{.Slug}}.html#comments</comments>
|
||||
<guid>https://{{$.Host}}/post/{{.Slug}}.html</guid>
|
||||
|
||||
@@ -3,6 +3,7 @@ package tools
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"html"
|
||||
htmpl "html/template"
|
||||
"io"
|
||||
"log"
|
||||
@@ -26,6 +27,7 @@ func init() {
|
||||
TplFuncMap["isnotzero"] = IsNotZero
|
||||
TplFuncMap["getavatar"] = GetAvatar
|
||||
TplFuncMap["imgtonormal"] = ImgToNormal
|
||||
TplFuncMap["xmlescape"] = html.EscapeString
|
||||
}
|
||||
|
||||
// Str2html string to html
|
||||
|
||||
Reference in New Issue
Block a user