Skip to content

why jsx syntax doesn't highlighted in hexo #2720

@Jaycexx

Description

@Jaycexx

Environment Info

Node version(node -v): v6.9.2

Your theme _config.yml (Optional): next

For 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?

//use ```javascript (or try: jsx) doesn't work
let items = ['textA', 'textB', 'textC'];
let list = items => items.map( text => <li>{ text }</li>);
let foo = (
    <div id="foo">
        zhi zhi zhi!
        <ul>
            {list(items)}
        </ul>    
    </div>
);
let items = ['textA', 'textB', 'textC'];
let list = items => items.map(text => Object(__WEBPACK_IMPORTED_MODULE_0__preact__["a" /* h */])(
    'li',
    null,
    text
));
let foo = 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)
    )
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions