Syntax Highligting in Markdown Code Blocks?



  • Hi,

    Is it possible to get language-specific syntax highlighting in the markdown code blocks? Something like what GitHub does? If not, what's the best way to submit suggestions for the forum?
    Thanks,

    Donovan



  • Hi Donovan, thanks for providing the feedback and I confirm we're working on it.

    I'll notify through post as soon as it will be available.

    Cheers, Riccardo



  • Great news, thanks!



  • Hi Donovan,

        the syntax highlighting should work now.

    void ThisIsATest()
    {
       // comment it out!
       cout << "This is an highlighted world!";
    }
    

    Cheers, Riccardo



  • Awesome! It works with

    python:

    print "Thank you!"
    

    and C++:

    cout << "For adding syntax highlighting!";
    


  • For everybody interested in syntax highlighting, nodeBB is pretty smart in recognizing the language you're using by simply checking your code snippet, but in case you really want to hard-code the language set simply use the following line when starting a code snippet:

    ```<language>
    

    where <language> can be anything like python or c++

    Cheers, Riccardo


Log in to reply