自动为网页上选中的文本生成锚点的 js 库 deeplinks.js

deeplinks.js

这个 JS 库可以自动为网页上选中的文本生成锚点,其他人访问带有这个锚点的 URL时,会自动跳转到锚点位置并突出展示选中文本。

参考 Demo

安装使用

安装很简单,只需要从 GitHub 上下载最新的代码,在需要的地方引入即可生效

<script type="module" src="/deeplinks/deeplinks.js"></script>

引用链接

[1] deeplinks.js: https://github.com/WesleyAC/deeplinks
[2] Demo: https://notebook.wesleyac.com/what-hypertext-could-be/#1GHfGDDIwx:21:63
[3] GitHub: https://github.com/WesleyAC/deeplinks/releases