提交 6aaa7d7a 编写于 作者: I Ivan Medina 提交者: ULIVZ

fix($markdown): notify error when not found snippet (close: #1872) (#1910)

上级 7c973abc
const { fs, path } = require('@vuepress/shared-utils')
const { fs, logger, path } = require('@vuepress/shared-utils')
module.exports = function snippet (md, options = {}) {
const fence = md.renderer.rules.fence
......@@ -15,8 +15,9 @@ module.exports = function snippet (md, options = {}) {
if (fs.existsSync(src)) {
token.content = fs.readFileSync(src, 'utf8')
} else {
token.content = 'Not found: ' + src
token.content = `Code snippet path not found: ${src}`
token.info = ''
logger.error(token.content)
}
}
return fence(...args)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册