MarkdownMinifier Class

Namespace
Kampute.DocToolkit.IO.Minifiers
Assembly
  • Kampute.DocToolkit.dll

Definition

A TextWriter that wraps another TextWriter to output well-formed Markdown content, minifying it by eliminating superfluous whitespace while preserving whitespace within code blocks to maintain the intended formatting.
public class MarkdownMinifier : WrappedTextWriter
Inheritance

Remarks

The MarkdownMinifier processes Markdown content by optimizing whitespace usage while ensuring that the formatting remains intact, particularly within code blocks. This helps improve readability and reduces unnecessary space without altering the Markdown's intended structure.
This writer assumes well-formed Markdown input. Malformed Markdown may result in unexpected minification behavior and potentially corrupt output.
This writer not only eliminates redundant whitespace but also improve readability and visual appeal of Markdown in plain text.

Thread Safety

Public static members of the type are guaranteed to be thread-safe. However, public instance members are not thread-safe.

Constructors

MarkdownMinifier(TextWriter, bool)Initializes a new instance of the MarkdownMinifier class.

Methods

Write(char)Writes a character to the text stream, if it is not redundant.