D0n9X1n / hexo-blog-encrypt

Yet, just another hexo plugin for security.
https://www.npmjs.com/package/hexo-blog-encrypt
MIT License
971 stars 101 forks source link

文章加密后代码块无法正常显示 #84

Closed naturerun closed 5 years ago

naturerun commented 5 years ago

Expected Behavior

代码块正常显示

Actual Behavior

代码块消失

Steps to Reproduce the Problem

文章解密后代码块消失,无法在解密的文章中正常显示

Specifications

(The version of the project, operating system, hardware etc.)

D0n9X1n commented 5 years ago

务必再明确下问题。

无法重现问题:测试网页:https://mhexo.github.io/example-site/2018/06/25/encrypt-test/

naturerun commented 5 years ago

这个问题我已经解决了,用markdown语法标记代码块,则网页内容AES加密并解密后代码部分在解密后的网页会丢失。但是,如果不加密文章但用markdown标记代码块,那么hexo g之后到public文件夹找到该文章对应的编译好的html文件,拷贝文件里代码块对应的html代码,然后在文章的md文件里重新加密文章,但代码块不用markdown标记,而是直接粘贴之前拷贝的代码块对应的html代码,这样hexo g hexo d之后进入发布的博客中的加密文章输入密码后代码块就能正常显示了。自己不太清楚这种现象发生的原因,有可能是插件或者第三方库对markdown语法的处理存在问题