hexojs/hexo-renderer-pandoc

hexo s error

Broduker opened this issue · 16 comments

when use hexo s, something was wrong

[ERROR][hexo-renderer-pandoc] pandoc exited with code 9: pandoc: Unknown extension: smart

Some people on the Internet said that it may be related to Pandoc's smart parameter, which is in the node_modules\hexo-renderer-pandoc\index.js file.

hi, could you check your pandoc version so i can reproduce your issue? also does using version above 2.0 fixes your issue?

---Original--- From: "Broduker"<notifications@github.com> Date: Mon, Nov 18, 2019 11:55 AM To: "wzpan/hexo-renderer-pandoc"<hexo-renderer-pandoc@noreply.github.com>; Cc: "Subscribed"<subscribed@noreply.github.com>; Subject: [wzpan/hexo-renderer-pandoc] hexo s error (#36) when use hexo s, something was wrong [ERROR][hexo-renderer-pandoc] pandoc exited with code 9: pandoc: Unknown extension: smart Some people on the Internet said that it may be related to Pandoc's smart parameter, which is in the node_modules\hexo-renderer-pandoc\index.js file. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

pandoc version pandoc-2.7.3-windows-x86_64

发现作者是**人,那我就用中文仔细陈述一遍吧。
我就是按照步骤先从官网下载了pandoc-2.7.3-windows-x86_64,并进行了安装
然后按照说明卸载原有的渲染器 hexo-renderer-marked,并安装了hexo-renderer-pandoc

uninstall hexo-renderer-marked
install hexo-renderer-pandoc 

然后在 next/_config.yml 中将 mathjaxenable 值设为true

但是运行hexo s出现如上所述错误。上网查阅发现有人可能遇到了相似的问题,给出的解决办法为
node_modules\hexo-renderer-pandoc\index.js中的

var args = [ '-f', 'markdown-smart'+extensions, '-t', 'html-smart', math]

改成

var args = [ '-f', 'markdown'+extensions, '-t', 'html', math]

修改后确实没有报错,参考的文章Hexo 搭建个人博客指南

hexo版本是4.0.0

@Broduker 您好,我尝试使用以下命令

<...>\pandoc-2.7.3-windows-x86_64\pandoc.exe -f markdown-smart -t html-smart source\_posts\hello-world.md

渲染成功没有报错。

可否再次确认你使用的 pandoc 版本?尤其是你安装的版本是否是命令行中搜索到的那个?请于回复中附上运行命令 pandoc -v 的结果。另外也请附上 _config.yml 以及 package.json.

哦,好像真是版本的问题,在git bash中查看版本的结果如下,跟我单独安装的版本确实不一样

$ pandoc -v
pandoc.exe 1.19.2.1
Compiled with pandoc-types 1.17.0.4, texmath 0.9, skylighting 0.1.1.4
Default user data directory: C:\Users\shens\AppData\Roaming\pandoc
Copyright (C) 2006-2016 John MacFarlane
Web:  http://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.

这是我在安装hexo默认已经下载的吗,或者什么其他软件,之前确实没有单独下载过。那这样的话怎么替换这个版本呢

好的,我尝试改改

好的,多谢

ok

找到了pandoc 1.19.2.1的来源,是anaconda3中集成的,卸载或升级包版本后问题解决,不过部分镜像源没有2.0以上版本,需要手动查找。
感谢答主,那我就把issue关了

补充一个手动安装pandoc最新版的方式(对于Ubuntu):

  • 卸载原本的sudo apt remove pandoc
  • 在任意目录下下载wget https://github.com/jgm/pandoc/releases/download/2.17.1.1/pandoc-2.17.1.1-1-amd64.deb
  • 手动安装sudo dpkg -i pandoc-2.17.1.1-1-amd64.deb