Skip to content

bugfix(decide): collapse internal whitespace so multi-line text stays one bullet#4

Open
CryptoJones wants to merge 1 commit into
mainfrom
bugfix/decide-multiline-collapse
Open

bugfix(decide): collapse internal whitespace so multi-line text stays one bullet#4
CryptoJones wants to merge 1 commit into
mainfrom
bugfix/decide-multiline-collapse

Conversation

@CryptoJones
Copy link
Copy Markdown
Owner

record_decision() formatted the bullet as - **{text} ({date})** where
text had only outer whitespace stripped. A multi-line decision like
socrates decide $'first\nsecond'
produced

  • first
    second (2026-05-20)

    which terminates the markdown list item at the first newline and leaves
    an unclosed ** on its own line — corrupting the DECISIONS.md file.

Fix: ' '.join(text.split()) to collapse every run of whitespace
(newlines, tabs, multiple spaces) into a single space before formatting.
Functionally a no-op for normal single-line inputs.

Test: assert a deliberately ugly multi-line input renders as a clean
single-line bullet with no stray newlines.

148/148 tests pass; ruff + mypy clean.

Self-review caveat: superseded in part by #refactor/shared-atomic-write-and-decide-lock, which folds in this same collapse logic. Merge whichever you prefer first; the refactor PR carries forward this fix.

… one bullet

`record_decision()` formatted the bullet as `- **{text} ({date})**` where
text had only outer whitespace stripped. A multi-line decision like
  socrates decide $'first\nsecond'
produced
  - **first
  second (2026-05-20)**
which terminates the markdown list item at the first newline and leaves
an unclosed `**` on its own line — corrupting the DECISIONS.md file.

Fix: ' '.join(text.split()) to collapse every run of whitespace
(newlines, tabs, multiple spaces) into a single space before formatting.
Functionally a no-op for normal single-line inputs.

Test: assert a deliberately ugly multi-line input renders as a clean
single-line bullet with no stray newlines.

148/148 tests pass; ruff + mypy clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant