# Place commas and periods inside quotation marks (EK00007)

import { Aside, Badge } from '@astrojs/starlight/components';

American English style places commas and periods inside the closing quotation mark, so a single, predictable pattern runs through your documentation. EkLine flags a comma or period placed outside a closing quotation mark (rule EK00007) so you can move it in.

## Why place commas and periods inside quotation marks?

Consistent quotation punctuation signals careful editing and matches the convention most software and API documentation follows. Placing commas and periods inside the closing mark keeps your prose aligned with American English style guides your readers expect. A single, predictable pattern also reads faster and avoids the visual snag of a stray mark after a quote.

## What EkLine flags

EK00007 matches a comma or period that sits directly after a closing quotation mark.

- ❌ **Incorrect:** The status is "active".
- ✅ **Correct:** The status is "active."
- ❌ **Incorrect:** Enter "yes", then continue.
- ✅ **Correct:** Enter "yes," then continue.

## How to fix

Move the comma or period so it sits inside the closing quotation mark.

<Aside type="note">
When the quotation marks enclose a literal value that a reader must type exactly — such as a command or a code string — keep the punctuation outside so it isn't mistaken for part of the value, and ignore the rule for that line.
</Aside>

## FAQ

### Do commas and periods go inside or outside quotation marks?

In American English style, commas and periods go inside the closing quotation mark. This is the convention most software and API documentation follows.

### When should you keep punctuation outside the quotation mark?

When the quotation marks enclose a literal value a reader must type exactly — such as a command or a code string — keep the punctuation outside so it isn't mistaken for part of the value.

## Rule details

| Property | Value |
|----------|-------|
| Rule ID | `EK00007` |
| Category | Spelling and grammar |
| Default severity | <Badge text="Error" variant="danger" /> |
| Enabled by default | No |

## Ignore this rule

To keep the punctuation outside the quotation mark on one line, add an inline comment:

```markdown
<!-- ekline-ignore-next-line EK00007 -- literal value, keep period outside -->
Set the flag to "true".
```

To disable the rule across your project, add it to the `ignore` list in your [configuration file](/reviewer/configuration/ignoring-rules/#ignore).

## Related rules

- [EK00028](/reviewer/rules/ek00028/) — Avoid spaces before or after a dash
- [EK00025](/reviewer/rules/ek00025/) — Use a single space between words