How to include a code block in your comment #1113
becky-gilbert
started this conversation in
General
Replies: 3 comments 4 replies
-
Why when you click the <> Add Code Block, In the GITHub comment block. it doesn't default to this automatically. It only outputs `` which makes the code look horrible, Had to search this to finally get it to look right. Is this a GITHUB Bug? |
Beta Was this translation helpful? Give feedback.
1 reply
-
What do I have to type to have highlighting for C language? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When posting a question on the forum, it's often helpful if you include your code. You can create a nicely-formatted code block in a discussion comment using three backticks (
`
) before and after your code, like this:And you can include the name of the programming language after the first set of backticks to get syntax highlighting. For instance, if you write the word javascript after the first three backticks, that will give you JavaScript syntax highlighting.
Or just "js":
Same goes for HTML:
After writing your code block, you can click on the 'Preview' tab at the top of the comment box to see how it will look when posted.
See here for more tips on using markdown in Github comments. 😃
Beta Was this translation helpful? Give feedback.
All reactions