Implement a transformer that reformats paragraph text so each sentence starts on a new line.
Background
Some documentation style guides (including projects that want clean diffs) require one sentence per line. This transformer enforces that rule.
Scope
- Visits
Paragraph nodes
- Splits inline content at sentence boundaries (
. , ? , ! heuristics — end of sentence followed by whitespace and an uppercase letter or end of content)
- Inserts a hard line break (Flexmark
SoftLineBreak or literal newline in output) between sentences
- Inline nodes (bold, italic, links, code spans) are treated as atomic units — sentence boundaries are not inserted inside them
- Fenced code blocks and inline code spans are skipped
Notes
- This is a best-effort heuristic — abbreviations (e.g. "e.g. ", "i.e. ") may produce false splits; document known limitations
- Sentence boundary detection algorithm is configurable/replaceable
Acceptance criteria
- A paragraph with multiple sentences is split, one sentence per line
- Inline nodes are not broken
- Code content is not modified
- A paragraph with a single sentence is unchanged
Implement a transformer that reformats paragraph text so each sentence starts on a new line.
Background
Some documentation style guides (including projects that want clean diffs) require one sentence per line. This transformer enforces that rule.
Scope
Paragraphnodes.,?,!heuristics — end of sentence followed by whitespace and an uppercase letter or end of content)SoftLineBreakor literal newline in output) between sentencesNotes
Acceptance criteria