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