ele828 / hexo-prism-plugin

Hexo plugin for code highlighting by prism.js, supporting JSX syntax
204 stars 51 forks source link

Failed to highlight C++ code #23

Closed fengwang closed 7 years ago

fengwang commented 7 years ago

inserting cpp source code such like

int function( double x )
{
    return std::floor( x );
}

but unfortunately the output code is not highlighted.

ele828 commented 7 years ago

Hi, it works well on my local machine. Did you add cpp annotation to your markdown?

```cpp    // Like this one
int function( double x )
{
    return std::floor( x );
}
\```

FYI, you can find supported language shorthand here: http://prismjs.com/#languages-list

If it's still not resolved, feel free to reopen this issue.

fengwang commented 7 years ago

@ele828 Thank you very much for your kind reply. I have tried both

    ```language-cpp
    //my code
and 
```cpp
//my code
````
but no luck.

In the `_config.xml` file, I have already set

highlight: enable: false line_number: false auto_detect: false tab_replace:

and 

prism_plugin: mode: 'realtime' theme: 'coy' line_number: true



One of the generated page demonstrating this problem is available at [this blog](http://fengwang.github.io/2017/06/02/std-optional-Maybe-Monad-in-C/)