sheng-tool
    Preparing search index...

    Function findTextQuoteAnchorIndex

    • 优先按唯一引文重新定位。短引文或重复引文依赖新旧文本中唯一且完全匹配的上下文。

      Parameters

      • text: string

        修改后的文本。

      • anchor: TextQuoteAnchor

        捕获的原文锚点。

      Returns number

      引文起始的 UTF-16 偏移。引文丢失或存在歧义时返回 -1。

      findTextQuoteAnchorIndex('新段落。开头。需要复核。结尾。', captureTextQuoteAnchor('开头。需要复核。结尾。', 3, 7)!)  // 7
      findTextQuoteAnchorIndex('引文已移除', captureTextQuoteAnchor('开头。需要复核。结尾。', 3, 7)!) // -1