在博客里面贴代码的时候发现,Dockerfile里面的指令中2个连接的’&’符号,被Crayon Syntax Highlighter代码插件转义为”&&”了。
网上找到了几个日文的资料来取消Crayon Syntax Highlighter对’&’符号的转义,步骤如下:
1.修改wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php文件,将第554行代码注释掉:
/* Convert <, > and & characters to entities, as these can appear as HTML tags and entities. */ if ($escape) { /* $code = CrayonUtil::htmlspecialchars($code); */ }
2.修改wp-content/plugins/crayon-syntax-highlighter/langs/default/operator.txt文件,在其中的”&=”和”&”前面加上’#’号注释掉。
before: &= & after: #&= #&
参考文档:
这在插件设置里面可以开启的,好像是叫做Decode HTML entities in code,勾选上就解决了
感谢提醒,目前已经换上更新更频繁的Enlighter了,后面如果还用Crayon的话再尝试一下。