rumdl 0.2.62

A fast Markdown linter written in Rust (Ru(st) MarkDown Linter)
Documentation
# MD055 - Keep table formatting consistent

Aliases: `table-pipe-style`

## What this rule does

Ensures all rows in your tables use the same style for leading and trailing pipe characters (|).

## Why this matters

- **Visual consistency**: Mixed pipe styles make tables look messy and unprofessional
- **Easier editing**: Consistent formatting makes it easier to add or modify table rows
- **Better alignment**: Uniform pipe placement helps maintain column alignment
- **Parser compatibility**: Some Markdown parsers require specific pipe styles

## Examples

<!-- rumdl-disable MD055 -->

### ✅ Correct (with leading and trailing pipes)

```markdown
| Name     | Role      | Department |
| -------- | --------- | ---------- |
| Alice    | Manager   | Sales      |
| Bob      | Developer | IT         |
```

### ✅ Correct (without leading and trailing pipes)

```markdown
Name     | Role      | Department
-------- | --------- | ----------
Alice    | Manager   | Sales
Bob      | Developer | IT
```

### ❌ Incorrect (mixed styles)

```markdown
| Name     | Role      | Department |
| -------- | --------- | ---------- |
Alice    | Manager   | Sales
| Bob      | Developer | IT         |
```

### 🔧 Fixed

```markdown
| Name     | Role      | Department |
| -------- | --------- | ---------- |
| Alice    | Manager   | Sales      |
| Bob      | Developer | IT         |
```

<!-- rumdl-enable MD055 -->

## Configuration

```toml
[MD055]
style = "consistent"  # Options: see below
```

### Style options

- **`consistent`** (default): Use the most prevalent style in the table (in case of a tie, `leading-and-trailing` is preferred as it's most widely used)
- **`leading-and-trailing`**: Require pipes at start and end: `| cell |`
- **`leading-only`**: Require pipes only at start: `| cell`
- **`trailing-only`**: Require pipes only at end: `cell |`
- **`no-leading-or-trailing`**: No pipes at start or end: `cell`

## Automatic fixes

This rule can automatically fix issues by:

- Adding missing leading pipes when required
- Adding missing trailing pipes when required
- Removing extra pipes when not allowed
- Making all rows match the configured style

## Markdown with Gherkin

Under the `mdg` flavor, MD055 always uses `leading_and_trailing`. Gherkin
recognizes a Data Table or Examples row only when an indent is followed directly
by a pipe, so `no_leading_or_trailing`, `leading_only` and `trailing_only` would
not express the required form: `no_leading_or_trailing` and `trailing_only`
remove the leading pipe, while `leading_only` omits the trailing pipe. None of
the three is adopted: the rule enforces `leading_and_trailing` anyway and
prints one `[config warning]` line on stderr when the rule reaches relevant
content. `consistent` resolves to the same form rather than by prevalence, and
is never reported.

A restyled row keeps the indentation it was written with, because that indent is
half of what makes it a Gherkin row. [MD060](md060.md) owns the indent's width.

See [Markdown with Gherkin Flavor](flavors/mdg.md) for the full flavor
specification.

## Learn more

- [Markdown Guide: Tables]https://www.markdownguide.org/extended-syntax/#tables
- [GitHub Flavored Markdown: Tables]https://github.github.com/gfm/#tables-extension-

## Related rules

- [MD056 - Keep table column count consistent]md056.md
- [MD058 - Add blank lines around tables]md058.md