Mattermost-server: [Help Wanted] [MM-13951] Allow "C" to be used for code block syntax highlighting

Created on 5 Feb 2019  路  2Comments  路  Source: mattermost/mattermost-server

If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.


Notes: Jira ticket

Original report: https://github.com/mattermost/mattermost-server/issues/10221

Summary
The C keyword does not work for code block syntax highlighting.

Steps to reproduce
Tested on server version 5.7.0 with desktop client version 4.2.0.

Expected behavior
Correct syntax highlighting on code blocks when the C or c keyword is used.

Observed behavior
While the cpp keyword does apply syntax highlighting,
it shows C/C++ as the language, and from that i would expect C to be a valid keyword to use this.

Possible fixes
highlight.js "supports" C as an alias (https://github.com/highlightjs/highlight.js/blob/master/src/languages/cpp.js#L98) for C++ but this is not used (https://github.com/mattermost/mattermost-webapp/blob/master/utils/syntax_highlighting.jsx#L72).

Easy Hackfest TecReactJS

Most helpful comment

@manland Go for it. I think that's useful.

All 2 comments

I'm work on this!

@hanzei It's possible to add sh as bash alias ? Every time I need to edit my previous post...

@manland Go for it. I think that's useful.

Was this page helpful?
0 / 5 - 0 ratings