Hexo: JS files are wrongly processed as HTML files

Created on 11 Feb 2018  ·  5Comments  ·  Source: hexojs/hexo

Environment Info

Node version(node -v): v8.9.4

Hexo and Plugin version(npm ls --depth 0):

[email protected] /home/yushijinhun/repos/hexo-test
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

For BUG

I initialized a fresh Hexo site with hexo init. Then I created a JavaScript file source/js/test.js, whose content is:

console.log("<test string>");

Then I executed hexo generate. I expect the rendered JS file to be same as the source. However, the content of the rendered file public/js/test.js is:

console.log("<test string="">");
</test>

Also, I did some research about this and found that, if I directly call hexo render source/js/test.js, the output is the same as expected.

skip-render stale

Most helpful comment

use skip_render if you simply want to copy files from source to destination, see #1633.

All 5 comments

Successfully reproduced.

screenshot

May the problem be caused by filtering HTML tags on JavaScript files?

use skip_render if you simply want to copy files from source to destination, see #1633.

Why the output of hexo generate is different from that of hexo render? Shouldn't they be the same?

@yushijinhun this is a know issue which we haven't figure out the fix yet.

This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pod4g picture pod4g  ·  24Comments

scaljeri picture scaljeri  ·  44Comments

wych42 picture wych42  ·  23Comments

fabien-h picture fabien-h  ·  22Comments

ghost picture ghost  ·  27Comments