Skip to content

Latest commit

 

History

History
111 lines (76 loc) · 2.37 KB

File metadata and controls

111 lines (76 loc) · 2.37 KB

MD027 - Multiple spaces after blockquote symbol

Tags: blockquote, indentation, whitespace

Aliases: no-multiple-space-blockquote

Fixable: Some violations can be fixed by tooling

Description

This rule is triggered when blockquotes have more than one space after the blockquote (>) symbol:

>  This is a blockquote with bad indentation
>  there should only be one.

To fix, remove any extraneous space:

> This is a blockquote with correct
> indentation.

Parameters

  • list_items: Include list items (boolean, default true)

Configuration

The list_items parameter controls whether this rule applies to list items within blockquotes. Setting it to false disables the rule for ordered and unordered list items within blockquotes.

Example configuration:

[linters.severity]
no-multiple-space-blockquote = "err"

[linters.settings.no-multiple-space-blockquote]
list_items = true  # Check list items (default)

To disable checking of list items in blockquotes:

[linters.settings.no-multiple-space-blockquote]
list_items = false  # Skip list items

Rationale

Consistent formatting makes it easier to understand a document. Inferring intended list indentation within a blockquote can be challenging; setting the list_items parameter to false disables this rule for ordered and unordered list items.

Examples

Valid

> This is a blockquote with correct indentation
> Another line in the blockquote

> > Nested blockquote
> > Second line

> - List item with single space
> - Another list item

> 1. Ordered list with single space
> 2. Another ordered item

Invalid

>  This blockquote has multiple spaces
>   This one has three spaces

> >  Nested blockquote with violation
>>   Another nested violation

>  - List item with multiple spaces
>   * Another list item with violation
>    1. Ordered list with violation

With list_items = false

When list_items is set to false, list items are not checked:

>  Regular text is still checked (violation)
>  - List item is ignored (no violation)
>   * Another list item is ignored (no violation)

Nested blockquotes

The rule applies to each level of nesting:

> Level 1 correct
>> Level 2 correct
>>  Level 2 violation (multiple spaces after second >)
> >  Alternative level 2 violation