Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Markdown text color within a code block

Tags:

markdown

I frequently need to paste a code section into a Markdown document and then I want to change some color in the text.

For example:

This is a code sample:
```
#include <stdio.h>

int main(void) {
    printf("Hello World!\n");
    return 0;
}
```

How can I set the text string "Hello World!" to the color red? I wish to use it as a code block since I don't want to reformat it to Markdown style.

like image 261
lucky1928 Avatar asked Jan 27 '17 17:01

lucky1928


1 Answers

You can't put color on it.

Try putting C like this:

```c
#include <stdio.h>

int main(void) {
    printf("Hello World!\n");
    return 0;
}
```

It will make your text seems as code.

like image 194
Villghust Avatar answered Oct 27 '22 11:10

Villghust