Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code block 的代码会被注释掉 #7

Closed
togo13duke opened this issue Oct 7, 2019 · 6 comments
Closed

code block 的代码会被注释掉 #7

togo13duke opened this issue Oct 7, 2019 · 6 comments

Comments

@togo13duke
Copy link
Contributor

只要有comment out的以下的代码都会被注释掉

  • Local环境的Code Block

image

  • Serve时的Code Block
    image
@xrr2016
Copy link
Owner

xrr2016 commented Oct 8, 2019

只要有comment out的以下的代码都会被注释掉

  • Local环境的Code Block

image

  • Serve时的Code Block
    image

我发现是启用了 hexo 自带的代码高亮后又用 hljs 高亮代码块造成的问题,hexo 自带的代码高亮不起作用,只能关闭 hexo 自带的代码高亮,然后自己使用 hljs 设置高亮了

highlight:
  enable: false
  line_number: false
  auto_detect: false
  tab_replace: false

@togo13duke
Copy link
Contributor Author

改了yml反倒代码高亮不起作用了。

image

是不是我少了什么配置 ??

_config.yml

highlight:
  enable: false
  line_number: false
  auto_detect: false
  tab_replace: false

package.json

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "hexo": {
    "version": "3.9.0"
  },
  "dependencies": {
    "hexo": "^3.9.0",
    "hexo-deployer-git": "^2.0.0",
    "hexo-generator-archive": "^0.1.5",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-index": "^0.2.1",
    "hexo-generator-tag": "^0.2.0",
    "hexo-renderer-ejs": "^0.3.1",
    "hexo-renderer-less": "^1.0.0",
    "hexo-renderer-marked": "^2.0.0",
    "hexo-renderer-stylus": "^0.3.3",
    "hexo-server": "^0.3.3",
    "hexo-wordcount": "^6.0.1"
  }
}

@xrr2016
Copy link
Owner

xrr2016 commented Oct 8, 2019

改了yml反倒代码高亮不起作用了。

image

是不是我少了什么配置 ??

_config.yml

highlight:
  enable: false
  line_number: false
  auto_detect: false
  tab_replace: false

package.json

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "hexo": {
    "version": "3.9.0"
  },
  "dependencies": {
    "hexo": "^3.9.0",
    "hexo-deployer-git": "^2.0.0",
    "hexo-generator-archive": "^0.1.5",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-index": "^0.2.1",
    "hexo-generator-tag": "^0.2.0",
    "hexo-renderer-ejs": "^0.3.1",
    "hexo-renderer-less": "^1.0.0",
    "hexo-renderer-marked": "^2.0.0",
    "hexo-renderer-stylus": "^0.3.3",
    "hexo-server": "^0.3.3",
    "hexo-wordcount": "^6.0.1"
  }
}

不是少了配置,是 hexo 自带的代码高亮有问题,要用 highlight.js 来进行代码高亮,等下发个版本解决这个问题

@togo13duke
Copy link
Contributor Author

thanks

@xrr2016
Copy link
Owner

xrr2016 commented Oct 8, 2019

thanks

发了个新版本,解决了这个问题,需要禁用 hexo 自带的代码主题高亮

@togo13duke
Copy link
Contributor Author

解决了,感谢。Good job!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants