Skip to content

Preserve intentional sentence breaks when wrapping prose #314

Description

@lodyai

Summary

mdtablefix --wrap rewrites intentionally separated sentences into a single paragraph line, even when the second sentence is a short navigational note such as See ... or a validation-log pointer such as Logs at .... This preserves Markdown semantics, but it produces worse prose diffs and less readable source.

Example

Input:

This step answers whether the simplest match can start, score, end, export a
final snapshot, and commit rewards without violating the validator contract.
See `docs/skyjoust-state-graphs.yaml` `match_lifecycle`, `scoring`, and
`rewards`.

Actual output:

This step answers whether the simplest match can start, score, end, export a
final snapshot, and commit rewards without violating the validator contract. See
`docs/skyjoust-state-graphs.yaml` `match_lifecycle`, `scoring`, and `rewards`.

A similar rewrite happened in an execution-plan progress list:

-  `make markdownlint`, `make nixie`, and `git diff --check`. All passed. Logs
-  at `/tmp/fmt-skyjoust-1-1-1-record-runtime-crate-split-as-adr.out`,
+  `make markdownlint`, `make nixie`, and `git diff --check`. All passed. Logs at
+  `/tmp/fmt-skyjoust-1-1-1-record-runtime-crate-split-as-adr.out`,

Expected behaviour

When wrapping prose, preserve an existing line break after sentence-ending punctuation if the following line begins a short sentence, especially when it starts with reference words such as See, Logs at, For, or similar source-navigation markers.

Actual behaviour

The formatter treats the paragraph as an unstructured word stream and moves the next sentence onto the prior line when that line has remaining width.

Why this matters

Project documentation often uses short follow-up sentences for references and validation artefacts. Reflowing them into the previous sentence makes the source harder to scan and creates noisy diffs unrelated to author intent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions