# MD037 - No Spaces Inside Emphasis Markers

## Description

This rule ensures that there are no spaces inside emphasis markers (asterisks or underscores).  
Spaces inside emphasis markers can cause inconsistent rendering across different Markdown processors.

<!-- markdownlint-disable -->
## Examples

### Valid

```markdown
This is *italic* text.

This is **bold** text.

This is ***bold italic*** text.
```

### Invalid

```markdown
This is * italic with spaces * text.

This is ** bold with spaces ** text.

This is * italic with a space at the beginning* and *italic with a space at the end *.
```

### Fixed

```markdown
This is *italic with spaces* text.

This is **bold with spaces** text.

This is *italic with a space at the beginning* and *italic with a space at the end*.
```
<!-- markdownlint-enable -->

## Special Cases

- This rule applies to both asterisk (*) and underscore (_) emphasis markers
- It checks for spaces immediately inside the opening and closing emphasis markers
- The rule does not affect spaces outside the emphasis markers
- It handles nested emphasis correctly
- The rule does not apply to code spans (backticks)

## Related Rules

- [MD049 - Emphasis style](md049.md): Ensures consistent style for emphasis markers
- [MD050 - Strong style](md050.md): Ensures consistent style for strong emphasis markers
- [MD036 - No emphasis as heading](md036.md): Prevents using emphasis instead of proper headings

## Configuration

This rule has no configuration options.

## Fix

The automatic fix for this rule removes spaces between emphasis markers and content.
