weasel API - v0.8.0
    Preparing search index...

    Function charOffsetToDomPosition

    • Walk the overlay's text nodes in document order and find the text node

      • offset that corresponds to plain-text character position offset. Offsets beyond the total text length clamp to the end of the last text node. Returns { node: parent, offset: 0 } when there are no text nodes.

      Parameters

      • parent: HTMLElement
      • offset: number

      Returns { node: Node; offset: number } | null