I already fixed it, the template is:
[[<% tp.file.cursor() %>|<% tp.file.selection() %>]]
It uses the selected input I don’t even need to copy it. Also the problem with the two brackets fixed by itself don’t know why, maybe some internal spaghetti.