我刚刚使用github + hexo创建了我的hexo blog.However,当使用代码块时,它根本不起作用,我想知道如何修复它。md文件中的代码是:
```js
var allp=$("div“);
Allp.attr(“类”,函数(i,n){
return Number(n)+1;
});
```js
Allp.each(函数(){
console.log(this);
});
但在浏览器中,我看到的是:
我试过很多方法来解决它,但都失败了。顺便说一下,我用的是hexo的下一个主题。
发布于 2019-02-22 04:52:54
我想你需要的是这个
{% codeblock code snippet 1 lang:js %}
var allp=$("div p");
allp.attr("class",function(i,n){
return Number(n)+1;
});
{% endcodeblock %}
{% codeblock code snippet 2 lang:js %}
allp.each(function(){
console.log(this);
});
{% endcodeblock %}
将上面的代码放入您的md文件中,您将得到这。
发布于 2019-03-23 15:25:54
也许您可以尝试以下步骤:
highlight:
enable: true
auto_detect: true
line_number: true
tab_replace:
hexo clean
清理缓存;hexo s
重新启动服务器;https://stackoverflow.com/questions/54709961
复制相似问题