How to Share a Link to a Particular Phrase

How to Share a Link to a Particular Phrase

如何分享指向特定段落的链接

Sometimes, when you send someone a link, you’re doing so just because you want them to read a particular paragraph or sentence. Maybe you’re helping a friend figure something out, and you know the exact information they need. Maybe you’re trying to settle an argument, and one particular paragraph indisputably proves you correct. Or maybe a particular line made you laugh, and you wanted to share it specifically.

有时,当你给别人发送链接时,只是因为你想让他们阅读特定的段落或句子。也许你正在帮助朋友解决问题,并且你知道他们需要的确切信息;也许你正试图平息一场争论,而某一段文字能无可辩驳地证明你是对的;又或者某一行文字让你忍俊不禁,你想专门分享它。

You could, in these circumstances, highlight the relevant paragraph and take a screenshot. That’s clumsy, though, and the person you’re sharing with can’t read more if they’re interested. Plus, there’s a better way.

在这种情况下,你可能会选择高亮相关段落并截屏。但这很笨拙,而且如果对方感兴趣,他们也无法阅读更多内容。此外,还有更好的方法。

Modern browsers—including Chrome, Safari, and Firefox—have a feature most people don’t know about: Copy Link to Highlight. And it’s surprisingly easy to use.

现代浏览器(包括 Chrome、Safari 和 Firefox)都有一个大多数人不知道的功能:复制指向高亮部分的链接(Copy Link to Highlight)。而且它使用起来非常简单。

In Chrome or Firefox simply highlight some text, right-click it, then click Copy Link to Highlight. On Safari the feature is called Copy Link with Highlight, only slightly different.

在 Chrome 或 Firefox 中,只需选中一段文字,右键点击,然后选择“复制指向高亮部分的链接”。在 Safari 上,该功能被称为“复制带高亮部分的链接”(Copy Link with Highlight),名称略有不同。

The feature works the same way on all three browsers. A URL like this is copied to your clipboard. The link works like any other, but the browser will jump to the relevant section and the selected words will be highlighted.

该功能在上述三款浏览器中的工作方式相同。一个类似这样的 URL 会被复制到你的剪贴板中。该链接的功能与其他链接无异,但浏览器会自动跳转到相关部分,并将选中的文字高亮显示。

This is very handy when you want to share an excerpt of writing in context, a concept that is totally lost if you just take a screenshot with a highlight.

当你想要分享带有上下文的摘录时,这个功能非常方便;如果你只是截屏并进行标注,上下文的概念就会完全丧失。

How This Works

其工作原理

This feature is made possible by a web standard called Text fragments. It’s been built into browsers for years now; it’s just not the kind of feature that made a lot of headlines at the time.

这项功能得益于一种名为“文本片段”(Text fragments)的网页标准。它内置于浏览器中已有多年,只是在当时并未引起太多关注。

The feature basically creates a URL that includes enough information for your browser to find the highlighted text portion. If you copy a URL made this way and paste it into a document so you can study the link’s structure, you can see how this works.

该功能本质上是创建了一个包含足够信息的 URL,以便浏览器找到高亮显示的文本部分。如果你复制这样一个 URL 并将其粘贴到文档中以研究其结构,就能明白它是如何工作的。

In the simplest cases, the URL will include the entire highlighted portion. That works fine for short fragments, but for long passages, the URL gets ungainly pretty fast. When you’re linking to longer text fragments, the URL includes a reference to the beginning and end of the excerpt. Either way, the URL tells your browser not only which page to load, but what part of the text should be highlighted. Your browser finds the text, highlights it, and jumps directly to it.

在最简单的情况下,URL 会包含整个高亮部分。这对于短片段来说效果很好,但对于长段落,URL 会迅速变得冗长笨重。当你链接到较长的文本片段时,URL 会包含摘录的起始和结束引用。无论哪种方式,URL 不仅告诉浏览器要加载哪个页面,还指明了应该高亮显示哪部分文本。浏览器会找到该文本,将其高亮显示,并直接跳转到该位置。

There are subtle differences in how browsers handle this. Safari highlights text in yellow, for example, whereas in my tests Chrome seemed to prefer purple. But since this URL structure is standardized across browsers, a link created in one browser works in every browser.

不同浏览器在处理此功能时存在细微差别。例如,Safari 会用黄色高亮显示文本,而在我的测试中,Chrome 似乎更倾向于紫色。但由于这种 URL 结构在各浏览器间是标准化的,因此在一个浏览器中创建的链接可以在所有浏览器中正常工作。

It’s worth noting this feature doesn’t work in all contexts. If the website you’re reading is behind a paywall, and the person you’re sharing with doesn’t have access, they probably won’t be able to see the excerpt you’re trying to share. The feature also doesn’t work inside PDF files, even when you open them in your browser.

值得注意的是,此功能并非在所有情况下都适用。如果你阅读的网站设有付费墙,而你分享的对象没有访问权限,他们可能无法看到你试图分享的摘录。此外,该功能在 PDF 文件中也不起作用,即使是在浏览器中打开 PDF 时也是如此。

But sharing a text fragment, in most cases, is a lot more useful than sharing a screenshot. Give it a try the next time you’re trying to win an argument online.

但在大多数情况下,分享文本片段比分享截图要有用得多。下次当你试图在网上赢得一场争论时,不妨试一试。