Skip to content

foldTsDocParagraphs

Collapse single newlines within paragraphs to spaces, preserve double newlines as paragraph breaks. Fenced code blocks (backtick or tilde fences) are preserved verbatim — their internal newlines are NOT folded, so embedded code survives to be re-emitted as a real code fence downstream.

Import:

import { foldTsDocParagraphs } from '@mnaoumov/typescript-dev-toolkit/docs-site/api-doc-text-utils';

Signature:

function foldTsDocParagraphs(text: string): string

Parameters:

Parameter Type Description
text string The text.

Returns: string — The folded text.