主题
fragment_link
为高亮添加带文本片段锚点的来源 URL。
语法
knap
{{ value | fragment_link:"https://example.com" }}
{{ value | fragment_link:"Source:https://example.com" }}用法
- 传入来源 URL。在它前面加上自定义链接文本和一个冒号,即可替换默认的
link文本。
示例
基本用法
json
{
"highlights": [
"Selected text",
"Another passage"
]
}knap
{{ highlights | fragment_link:"https://example.com" }}md
["Selected text [link](https://example.com#:~:text=Selected%20text)","Another passage [link](https://example.com#:~:text=Another%20passage)"]自定义链接文本
json
{
"highlights": [
"Selected text",
"Another passage"
]
}knap
{{ highlights | fragment_link:"Source:https://example.com" }}md
["Selected text [Source](https://example.com#:~:text=Selected%20text)","Another passage [Source](https://example.com#:~:text=Another%20passage)"]