Garbled code will be generated if .md file contains too many Chinese characters
This issue is originally posted at https://github.com/ahonn/hexo-theme-even/issues/46
I have the same problem, Here is the md file https://raw.githubusercontent.com/yangg/blog/master/source/_posts/weixin-app.md
Hmmm, definitely an issue. But is it the rendering issue or the server issue?
https://github.com/hexojs/hexo/issues/2171
It renders correct after deploy, so I file the issue here.
mark 遇到同样的问题,好疑惑
Sometimes the 'over-flooded' Chinese characters just get cut out, instead of being replaced by random symbols.
Still got the same result on hexo: 3.3.1 when rendered in the localhost, but it's rendered correctly on github.
It seems that the response is corrupt. The end of response body seems to be truncated and mixed up with some, e.g.:
<script type="text/javascript" src="/ "undefined" && _ctx.name !== null) ? ((typeof _ctx.name !== "undefined" && _ctx.name !== null) ? _ctx.name : "") : ((typeof name !== "undefined" && name !== null) ? name : "")) !== null ? ((t
It should be something like:
<script type="text/javascript" src="/js/src/motion.js?v=5.1.1"></script>
<script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.1"></script>
<script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.1"></script>
instead.
This's actually a regression caused by commit 4103a759e406ed4d9cda123ae6afe8a77f8f9432.
By enabling the compression can quickly avoid this problem:
server:
compress: true
The solution of @wayou is actually correct. But the description seems inconsistent with code? disabling or enabling?