Languages
[Edit]
EN

Markdown - how to make blocks of TypeScript code (syntax highlighting - github, dev.to, stackoverflow)

0 points
Created by:
Dirask Community
5460

In this article, we would like to show you how to create blocks of TypeScript code with syntax highlighting in markdown.

To create a block of TypeScript code with syntax highlighting you need to wrap your code with three backticks (```) and tell markdown it's typescript in the first line right after backticks.

Note: You can also type ts instead of whole typescript word.

Practical example:

```typescript
let array = [
    {
        id : 1,
        group : 'Juices',
        items : [
            { name : 'Apple',   price : 1.4 },
            { name : 'Orange',  price : 1.7 }
        ]
    }
];
```

Result from github.com:

Markdown - highlighted TypeScript code example on github.com

Result from dev.to:

Markdown - highlighted TypeScript code example
Markdown - highlighted TypeScript code example on dev.to

 Result from stackoverflow.com:

Markdown - highlighted TypeScript code example on stackoverflow.com
Native Advertising
­čÜÇ
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

ÔŁĄ´ŞĆ­čĺ╗ ­čÖé

Join