-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如果md文件名中含有&等特殊字符,使用chrome浏览器等读取sitemap.xml会出现错误 #1
Comments
@tommy351 I think Hexo was too lenient in generating links. This brings us back to the definition of permalink hexojs/hexo#881 (comment). |
One way to do it is to escape the permalink when generating it (except the domain part, which shall be punycoded). const { format, parse } = require('url');
permalink = permalink.format({
protocol: parse(permalink).protocol,
hostname: parse(permalink).hostname,
pathname: encodeURI(parse(permalink).pathname)
}); This touches the same codebase as hexojs/hexo#3691 |
|
Hello~我想要部屬文章時跳出了這些錯誤,初步判斷應該是跟關鍵字有關與符號有關,但看了解決方法後,依然不知道怎麼改正,也將文章中有的特殊符號或關鍵字拿掉了,但依然無法成功部屬,請問在程式碼片端中出現特殊符號 (EX.
|
Looks like a conflict with tag plugin syntax. Do you have |
yes, I got the problem and solved it, thank you! |
sitemap.ejs中处理使用encodeURI函数处理了url:
如果创建文件
/source/_posts/hello&world.md
(文件名有点怪),能够正常访问http://127.0.0.1:4000/hello&world/
,但是使用Firefox29,chrome30+访问/sitemap.xml会出现类似于下面的错误:encodeURI没有对&等字符进行处理,但是在静态博客中除了#其他的特殊字符可以不具有特殊意义。
我觉得可以再加些处理,例如
The text was updated successfully, but these errors were encountered: