Skip to main content
Run any Skill in Manus
with one click

text-highlight-recover

Stars0
Forks0
UpdatedJuly 14, 2026 at 19:48

网页文本高亮 / 划词批注的「模糊恢复」——保存的是文本锚点(引用文本 exact + 前后上下文 prefix/suffix + 字符偏移 position),而不是 DOM 路径 / XPath / nth-child。页面重渲染、空白重排、正文被小幅编辑之后,用三层降级 position→exact→fuzzy 把高亮重新定位回来:fuzzy 用「首尾自由 gap」的编辑距离做近似子串匹配,容忍错字与增删词并给出相似度分数,低于阈值判定丢失。零依赖单文件、纯 TS,含 Range↔偏移与无损 <span> 高亮绘制。当用户提到 高亮/划词/批注恢复、highlight 重新定位、restore highlight after re-render、text anchor / text fragment、DOM 变了高亮丢了、模糊匹配找回选区、W3C Web Annotation TextQuoteSelector 时使用。

Installation

Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.

File Explorer
2 files
SKILL.md
readonly