sheng-tool
    Preparing search index...

    Function captureTextQuoteAnchor

    • 记录引文和附近的文本,以便在文档修改后重新定位。

      Parameters

      • text: string

        原文本。

      • start: number

        起始 UTF-16 偏移,包含该位置。

      • end: number

        结束 UTF-16 偏移,不包含该位置。

      • __namedParameters: { contextLength?: number; minimumQuoteLength?: number } = {}

      Returns TextQuoteAnchor | null

      引文锚点。空白选区或无效的偏移返回 null。

      选项不是非负安全整数。

      captureTextQuoteAnchor('开头。需要复核。结尾。', 3, 7)?.quote  // '需要复核'
      captureTextQuoteAnchor('空白 ', 2, 3) // null