You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I specified code block as follow. But when i deploy the site and found syntax highlight doesn't work. I guess it 's the reason of dom element in jsx. How can i fix it?
//use ```javascript (or try: jsx) doesn't workletitems=['textA','textB','textC'];letlist=items=>items.map(text=><li>{text}</li>);letfoo=(<divid="foo">
zhi zhi zhi!
<ul>{list(items)}</ul></div>);letitems=['textA','textB','textC'];letlist=items=>items.map(text=>Object(__WEBPACK_IMPORTED_MODULE_0__preact__["a"/* h */])('li',null,text));letfoo=Object(__WEBPACK_IMPORTED_MODULE_0__preact__["a"/* h */])('div',{id: 'foo'},'zhi zhi zhi!',Object(__WEBPACK_IMPORTED_MODULE_0__preact__["a"/* h */])('ul',null,list(items)));
The text was updated successfully, but these errors were encountered:
highlight.js does not support JSX syntax, see highlightjs/highlight.js#931. So there is not much thing hexo can do about.
@NoahDragon Maybe we can consider switching highlight to prism? It brings better support on JSX. I think most of our users will prefer showcasing JS, TS, JSX codes since we are a node.js project. Any thoughts?
Environment Info
Node version(
node -v
): v6.9.2Your theme
_config.yml
(Optional): nextFor question
I specified code block as follow. But when i deploy the site and found syntax highlight doesn't work. I guess it 's the reason of
dom
element in jsx. How can i fix it?The text was updated successfully, but these errors were encountered: