DprintMarkdownFormatter.StringUtils (dprint_markdown_formatter v0.5.1)

View Source

String processing utilities for markdown formatting.

This module contains pure functions for processing and normalizing markdown content, particularly for handling heredoc content and whitespace normalization.

Summary

Functions

Performs final cleanup of whitespace in formatted content.

Functions

final_cleanup_whitespace(content)

@spec final_cleanup_whitespace(String.t()) :: String.t()

Performs final cleanup of whitespace in formatted content.

Removes whitespace-only lines that may have been left by intermediate processing steps, particularly in heredoc structures.

Examples

iex> DprintMarkdownFormatter.StringUtils.final_cleanup_whitespace("line1\n   \nline2")
"line1\n\nline2"

iex> DprintMarkdownFormatter.StringUtils.final_cleanup_whitespace("line1\n\t\t\nline2")
"line1\n\nline2"