Markdown 标题空行调查摘录

  • Captured: 2026-04-12
  • Sources:
    • CommonMark Spec / GitHub Flavored Markdown Spec
    • markdownlint MD022 documentation

Checked points

Syntax side

  • CommonMark current spec states: ATX headings need not be separated from surrounding content by blank lines.
  • GitHub Flavored Markdown spec gives the same guidance.
  • Therefore, for #-style headings, a blank line after the heading is not required by Markdown syntax.

Style side

  • markdownlint rule MD022 says headings should be surrounded by blank lines.
  • Its rationale is mainly style/readability, plus compatibility with some parsers.
  • So blank lines around headings are a style convention, not a hard Markdown syntax requirement.

Working conclusion

  • # 标题 followed immediately by text on the next line is syntactically valid Markdown.
  • Leaving one blank line after a heading is a common style rule and can be adopted as a local writing standard.