Skip to content
This repository has been archived by the owner on Jan 20, 2023. It is now read-only.

Commit

Permalink
fix($core): empty node: Cannot read property 'format' of undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed Feb 8, 2019
1 parent 9a5167f commit 3c0c3bc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3c0c3bc

Please sign in to comment.