This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy at the same URL with .md appended. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation

WordBreakOptions Pennington.Infrastructure

Configures WordBreakHtmlRewriter — which elements receive word-break opportunities and how each break is rendered.

Properties

CssSelector string
CSS selector identifying the elements whose text gets word-break opportunities. Only elements that contain text and no child elements are rewritten; to reach text wrapped in an inline element, name that element directly (for example add span) rather than using a descendant combinator like h1 * — descendant combinators force AngleSharp to scan every element on the page. Defaults to headings, spans, and the .text-break class.
MinimumCharacters int
Minimum length a word must reach before any break is inserted. Defaults to 20.
WordBreakCharacters string
Markup inserted at each break opportunity. Defaults to <wbr>.

Pennington.Infrastructure.WordBreakOptions

namespace Pennington.Infrastructure;

/// Configures WordBreakHtmlRewriter — which elements receive word-break opportunities and how each break is rendered.
public class WordBreakOptions
{
    /// CSS selector identifying the elements whose text gets word-break opportunities. Only elements that contain text and no child elements are rewritten; to reach text wrapped in an inline element, name that element directly (for example add span) rather than using a descendant combinator like h1 * — descendant combinators force AngleSharp to scan every element on the page. Defaults to headings, spans, and the .text-break class.
    
public string CssSelector { get; set; }
/// Minimum length a word must reach before any break is inserted. Defaults to 20.
public int MinimumCharacters { get; set; }
/// Markup inserted at each break opportunity. Defaults to <wbr>.
public string WordBreakCharacters { get; set; }
}