# MD009 - No Trailing Spaces

This rule enforces that there are no trailing spaces at the end of lines.

## Description

Lines in the Markdown document should not have trailing whitespace characters (spaces or tabs) at the end.
Trailing whitespace can cause issues with some Markdown parsers and is generally considered bad practice.

## Configuration

- `br_spaces`: Number of spaces considered as a hard line break (default: 2)
- `strict`: Whether to enforce no trailing spaces even for hard line breaks (default: false)

## Examples

<!-- markdownlint-disable -->
### Valid

```markdown
This line has no trailing spaces
And this line also has none
```

### Invalid

```markdown
This line has trailing spaces  
And this one too 
```

### Fixed

```markdown
This line has no trailing spaces
And this one is fixed too
```
<!-- markdownlint-enable -->

### Special Cases

- When `strict` is false, lines ending with exactly `br_spaces` spaces are allowed (for hard line breaks)
- Empty lines (containing only whitespace) should have all spaces removed
- Spaces in code blocks are preserved unless `strict` is true

## Related Rules

- [MD010 - No hard tabs](md010.md)
- [MD047 - Files should end with a single newline character](md047.md)
