Skip to content
Permalink
Browse files

fix($core): empty node: Cannot read property 'format' of undefined

  • Loading branch information...
ulivz committed Feb 8, 2019
1 parent 9a5167f commit 3c0c3bc927b6e22097ae28a0b0f0fe60425b73c3
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/index.js
@@ -116,14 +116,13 @@ module.exports = (opts, ctx) => {
spinner.start(`Fetching ${chalk.cyan(title)} ... `)

const { status, data } = await yuque.getPage(slug)
const format = data.format
debug('status = ', status, 'format = ', format)
debug('status = ', status)

let postContent
if (status && status === 404) {
postContent = `# ${title}\n > 此文档尚未创建`
} else {
if (useMarkdown || format === 'markdown') {
if (useMarkdown || data.format === 'markdown') {
postContent = data.body
} else {
postContent = prettify(data.body_html)

0 comments on commit 3c0c3bc

Please sign in to comment.
You can’t perform that action at this time.