fragment_link

Add a source URL with a text-fragment anchor to highlights.

Syntax

{{ value | fragment_link:"https://example.com" }}

Example

01

Basic usage

InputTS
1{2  "highlights": [3    "Selected text",4    "Another passage"5  ]6}
TemplateKNAP
1{{ highlights | fragment_link:"https://example.com" }}
OutputKNAP
1["Selected text [link](https://example.com#:~:text=Selected%20text)","Another passage [link](https://example.com#:~:text=Another%20passage)"]

Behavior

  • Pass the source URL as the parameter.