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

关于5.1.0版本使用gulp优化问题 #1494

Closed
moyu-java opened this issue Mar 10, 2017 · 6 comments
Closed

关于5.1.0版本使用gulp优化问题 #1494

moyu-java opened this issue Mar 10, 2017 · 6 comments

Comments

@moyu-java
Copy link

Expected behavior (预期行为)

使用hexo g && gulp对网页进行压缩。

Actual behavior (实际行为)

报错如下:
events.js:160
throw er; // Unhandled 'error' event
............
at new HTMLParser (D:\Blog\Kylin\node_modules\html-minifier\src\htmlparser.js:236:13)
at minify (D:\Blog\Kylin\node_modules\html-minifier\src\htmlminifier.js:962:3)
at Object.exports.minify (D:\Blog\Kylin\node_modules\html-minifier\src\htmlminifier.js:1315:10)
at objectAssign.fileName (D:\Blog\Kylin\node_modules\gulp-htmlmin\index.js:22:39)
at module.exports (D:\Blog\Kylin\node_modules\tryit\tryit.js:8:9)
at minifyHtml (D:\Blog\Kylin\node_modules\gulp-htmlmin\index.js:21:9)
at Transform.htmlminTransform [as _transform] (D:\Blog\Kylin\node_modules\gulp-htmlmin\index.js:51:7)
at Transform._read (D:\Blog\Kylin\node_modules\gulp-htmlmin\node_modules\readable-stream\lib_stream_transform.js:159:10)
at Transform._write (D:\Blog\Kylin\node_modules\gulp-htmlmin\node_modules\readable-stream\lib_stream_transform.js:147:83)
at doWrite (D:\Blog\Kylin\node_modules\gulp-htmlmin\node_modules\readable-stream\lib_stream_writable.js:347:64)

Steps to reproduce the behavior (重现步骤)

gulp压缩采用的方式为 #665 中的方式。以前使用都是没有问题的。更新到5.1.0之后出现这个问题。

NexT Informations

Add the ✔ sign before an item which is affected by this behavior.

NexT Version:

✔ - Master

  • Latest Release
  • Old version -

NexT Scheme:

  • All schemes
  • Muse
    ✔ - Mist
  • Pisces

Other Informations (Like Browser, System, Screenshots)

@iissnan
Copy link
Owner

iissnan commented Mar 10, 2017

There might be something wrong with the generate HTML. Could you please generate without html-minifier and then validate the HTML using Markup Validation Service to see the potential problem(s) and provide the result here?

@moyu-java
Copy link
Author

@iissnan 错误太多,不好贴,我的网站是http://dkylin.com,我已经编译过了。没有用gulp压缩。

@iissnan
Copy link
Owner

iissnan commented Mar 10, 2017

The line should be the root cause. Could you please remove the }}" and run gulp to see if error was gone?

@moyu-java
Copy link
Author

@iissnan 非常感谢,已经可以了。

iissnan added a commit that referenced this issue Mar 10, 2017
@jetyu
Copy link

jetyu commented Mar 16, 2017

https://jetyu.me/%E6%8A%80%E6%9C%AF/20170202.html

@moyu-java
Copy link
Author

@jetyu Thank u.

habren pushed a commit to habren/hexo-theme-next that referenced this issue Apr 9, 2017
habren pushed a commit to habren/hexo-theme-next that referenced this issue Apr 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants