Need help with highlights in a web clipper template
Output I want:
Highlight 1 %%timestamp%%
***
Highlight 2 %%timestamp%%
Current output:
"Highlight 1" %%"2024-12-20T13:54:35.191Z"%%
***
"Highlight 2" %%"2024-12-20T13:54:35.191Z"%%
What I have:
{{highlights|map:item =>item.text %%item.timestamp%%|join:\n\n***\n\n}}
How do I get rid of the quotes around item.text
and item.timestamp
? (Without stripping any quotes that item.text
’s value may contain.)
Also asked this on Discord.
This solution was shared on Discord:
{{highlights}}
already returns an object, so you can use the template filter without a map
filter.
{{highlights|template:"${text} %%${timestamp}%%<@>"|split:"<@>"|slice:0,-1|join:"\n\n***"}}
It’s not possible to use more than one line break with template filter. for this reason, I used these extra filters as an “anchor point” to do this.
system
Closed
January 18, 2025, 11:34am
3
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.