Code Blocks

Description

Code blocks display formatted code with syntax highlighting and preserve formatting including indentation and line breaks. They support language specification for syntax highlighting and can include custom attributes for theming and display options.

.md markdown syntax

Fenced Code Blocks

```javascript
function example() {
  console.log('Hello, world!');
  return 'success';
}

### Code Blocks without Language
```markdown

Plain text code block No syntax highlighting

Indented Code Blocks

Code Blocks with Custom Attributes

Examples

JavaScript Code

Configuration file content: server.port=8080 database.url=localhost:5432 cache.enabled=true

SQL Query

Python:

Rust:

Last updated