Skip to content

Template header fields collapse to single line when markdownlint strips trailing spaces #1343

@echarrod

Description

@echarrod

Problem

The template header sections in spec-template.md, plan-template.md, and tasks-template.md use trailing double spaces ( ) to create line breaks between metadata fields. This is fragile and doesn't render correctly in many Markdown parsers, including:

  • GitHub rendered Markdown
  • JetBrains IDEs (IntelliJ, WebStorm, etc.)
  • Some VS Code preview configurations

Expected Rendering

**Feature Branch**: `002-grafana-integration`

**Created**: 2025-12-15

**Status**: Draft

**Input**: User description: "..."

Actual Rendering

All fields appear on a single line:

**Feature Branch**: 002-grafana-integration **Created**: 2025-12-15 **Status**: Draft **Input**: User description: "..."

Root Cause

This issue is likely caused by markdownlint's MD009 rule (no-trailing-spaces) which strips trailing whitespace from Markdown files.

How it happens

  1. Templates use trailing double spaces ( ) for soft line breaks
  2. User opens/saves the file in an editor with markdownlint enabled
  3. MD009 auto-fix removes the trailing spaces
  4. Lines now render on a single line since the line break syntax is gone

Why br_spaces: 2 doesn't always help

While MD009 has a br_spaces parameter that allows 2 trailing spaces for hard breaks by default, many projects:

  • Configure strict: true which reports trailing spaces even when they create valid breaks
  • Use auto-fix on save which strips them before users notice
  • Have CI pipelines that fail on trailing spaces

Affected Tools

markdownlint is widely integrated across the ecosystem:

Tool Integration
VS Code vscode-markdownlint extension
Sublime Text markdownlint plugin
Vim/Neovim coc-markdownlint extension
Emacs flymake-markdownlint-cli2
GitHub Actions markdownlint-cli2, nosborn/github-action-markdown-cli
CI/CD Grunt, Cake, ESLint plugin, MSBuild

Proposed Fix

Add blank lines between each metadata field to ensure consistent rendering:

**Feature Branch**: `[###-feature-name]`

**Created**: [DATE]

**Status**: Draft

**Input**: User description: "$ARGUMENTS"

Why blank lines are the better solution

Using blank lines instead of trailing spaces:

  • Is immune to linter auto-fix behavior
  • Is visually obvious in source files
  • Works consistently across all Markdown parsers
  • Follows the principle of explicit over implicit formatting

Affected Files

  • templates/spec-template.md
  • templates/plan-template.md
  • templates/tasks-template.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions