text-visual-diff
    Preparing search index...

    Interface HighlightSegment

    A single highlighted region inside the source HTML.

    Each segment corresponds to a contiguous run of characters that share the same highlight type (matched or unmatched). Structural HTML tags split segments — for example, <p>Hello <b>world</b></p> produces two matched segments: "Hello " (before the <b>) and "world" (inside it).

    interface HighlightSegment {
        sourceEnd: number;
        sourceStart: number;
        text: string;
        type: "matched" | "unmatched" | "added";
    }
    Index

    Properties

    sourceEnd: number

    End offset (exclusive) of this region within the original sourceHtml.

    sourceStart: number

    Start offset (inclusive) of this region within the original sourceHtml.

    text: string

    The visible text content inside this region.

    type: "matched" | "unmatched" | "added"

    Whether this region matched the target, was unmatched, or was added.