Sentence Spacing Rule

This rule enforces consistent spacing between sentences in text, specifically checking for proper spacing after end-of-sentence punctuation marks (periods, question marks, and exclamation points). The rule helps maintain readability and follows standard typographic practices by ensuring there is exactly one space between sentences.

The motivation behind this rule is to promote consistent and professional-looking text. While some writers use two spaces after sentences (a practice that originated in the typewriter era), modern style guides generally recommend using a single space between sentences for cleaner, more consistent typography.

Examples

Will flag:

  • This is a sentence.. This is another. (two spaces after period)
  • Hello!This is wrong. (no space after exclamation point)
  • What? Too many spaces. (two spaces after question mark)

Correct usage:

  • This is a sentence. This is another. (one space after period)
  • Hello! This is correct. (one space after exclamation point)
  • What? This is right. (one space after question mark)

The rule uses regular expressions to detect both missing spaces and multiple spaces between sentences, ensuring consistent spacing throughout your document.

Rule Source

This rule comes from: https://github.com/mesosphere/dcos-docs-site

Rule Definition

extends: existence
message: "'%s' should have one space."
link: https://docs.microsoft.com/en-us/style-guide/punctuation/periods
level: error
nonword: true
tokens:
  - '[a-z][.?!] {2,}[A-Z]'
  - '[a-z][.?!][A-Z]'