2022-10-29 23:21:45 -07:00
|
|
|
This rule is triggered when unwanted or different code block styles are used in
|
|
|
|
the same document.
|
|
|
|
|
2022-11-05 17:34:37 -07:00
|
|
|
In the default configuration this rule reports a violation for the following
|
|
|
|
document:
|
2022-10-29 23:21:45 -07:00
|
|
|
|
|
|
|
<!-- markdownlint-disable code-block-style -->
|
|
|
|
|
|
|
|
Some text.
|
|
|
|
|
|
|
|
# Indented code
|
|
|
|
|
|
|
|
More text.
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
# Fenced code
|
|
|
|
```
|
|
|
|
|
|
|
|
More text.
|
|
|
|
|
|
|
|
<!-- markdownlint-restore -->
|
|
|
|
|
|
|
|
To fix violations of this rule, use a consistent style (either indenting or code
|
|
|
|
fences).
|
|
|
|
|
2024-10-07 22:08:16 -07:00
|
|
|
The configured code block style can be specific (`fenced`, `indented`) or can
|
|
|
|
require all code blocks match the first code block (`consistent`).
|
2022-10-29 23:21:45 -07:00
|
|
|
|
|
|
|
Rationale: Consistent formatting makes it easier to understand a document.
|