typecho代码高亮插件在pjax下重载
CodeHighlighter-for-Typecho代码高亮插件重载代码,由于该插件基于prism.js,则进行以下操作。 </body> 标签前添加: <script type="text/javascript"> $(document).on('pjax:complete', function() { if (typeof Prism !== 'undefined') { Prism.highlightAll(true,null); } }); </script> highlight.jsajax重载代码 <script type="text/javascript"> $(document).on('pjax:complete', function() { document.querySelectorAll('pre code').forEach((block) => { hljs.highlightBlock(block); }); }); </script>