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

1个奇怪的问题。 #1228

Closed
437153 opened this issue Apr 25, 2015 · 3 comments
Closed

1个奇怪的问题。 #1228

437153 opened this issue Apr 25, 2015 · 3 comments

Comments

@437153
Copy link

437153 commented Apr 25, 2015

[root@localhost hexo]# hexo g
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
TypeError: Cannot read property '1' of undefined
    at /var/hexo/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:36:27
    at String.replace (native)
    at Hexo.backtickCodeBlock (/var/hexo/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:16:31)
    at Hexo.tryCatcher (/var/hexo/node_modules/hexo/node_modules/bluebird/js/main/util.js:24:31)
    at Hexo.<anonymous> (/var/hexo/node_modules/hexo/node_modules/bluebird/js/main/method.js:15:34)
    at /var/hexo/node_modules/hexo/lib/extend/filter.js:68:35
    at tryCatcher (/var/hexo/node_modules/hexo/node_modules/bluebird/js/main/util.js:24:31)
    at ReductionPromiseArray._promiseFulfilled (/var/hexo/node_modules/hexo/node_modules/bluebird/js/main/reduce.js:103:38)
    at ReductionPromiseArray.init [as _init$] (/var/hexo/node_modules/hexo/node_modules/bluebird/js/main/promise_array.js:92:18)
    at ReductionPromiseArray.init (/var/hexo/node_modules/hexo/node_modules/bluebird/js/main/reduce.js:40:10)
    at Async._drainQueue (/var/hexo/node_modules/hexo/node_modules/bluebird/js/main/async.js:180:12)
    at Async._drainQueues (/var/hexo/node_modules/hexo/node_modules/bluebird/js/main/async.js:185:10)
    at Async.drainQueues (/var/hexo/node_modules/hexo/node_modules/bluebird/js/main/async.js:15:14)
    at process._tickCallback (node.js:448:13)

今天我新写了一篇文章,在生成静态页面的时候会出错。如果我把这篇文章,从(_posts)目录删除,却可以正常执行hexo g
请求指导我该如何解决这个问题!

@naokiy
Copy link
Contributor

naokiy commented Apr 25, 2015

I found the problem. I think this is a bug but we can avoid it.

For example...

``` (tab character)
Hello world
```

If you write a tab character instead of language name, The same error will occur.
The characters these meet all of below three conditions will cause this.

  • It is not white space (" ").
  • It is not line break.
  • But it matches \s of regular expression.

Tab character matches these conditions.

When you remove unnecessary characters, that error will be solved... I think.

@437153
Copy link
Author

437153 commented Apr 26, 2015

很感谢你的帮助。

问题果然如你所说是在(``` (tab character))这个地方多了一个空格键,删除之后再次(hexo g)没有错误提示了。

I appreciate your help.
The problem really is, as you say in (`` `(tab character)) this place more than a spacebar, then removed again (hexo g) no error prompted.

@Fazx
Copy link

Fazx commented Jul 19, 2018

@naokiy thanks!

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

4 participants