Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 1.44 KB

File metadata and controls

53 lines (35 loc) · 1.44 KB

MD055 - table-pipe-style

Tags: table

Aliases: table-pipe-style

Parameters: style ("consistent", "leading_and_trailing", "leading_only", "trailing_only", or "no_leading_or_trailing"; default "consistent")

This rule is triggered for tables that don't have a consistent style for their leading and trailing pipe characters.

Rationale

Some parsers have difficulty with tables that are missing their leading or trailing pipe characters. The use of leading/trailing pipes can also help provide visual clarity.

Examples

The following table is missing its trailing pipe characters:

| Header | Header |
| ------ | ------
Cell | Cell |

The following table is missing its leading pipe characters:

Header | Header |
------ | ------ |
Cell | Cell |

Both of the above cases can be fixed by adding the missing pipe characters:

| Header | Header |
| ------ | ------ |
| Cell | Cell |

Configuration

The style parameter can be used to specify which pipe style to expect:

  • consistent - Tables must have the same style as the first table
  • leading_and_trailing - Tables must have pipes at the beginning and end of every row
  • leading_only - Tables must have pipes at the beginning of every row
  • trailing_only - Tables must have pipes at the end of every row
  • no_leading_or_trailing - Tables must not have pipes at the beginning or end of rows

Fixable

This rule supports automatic fixing of violations.