Hi there,
It looks like you’re losing the <?php echo $link; ?>
portion of your note. That’s because the plugin takes measures to ensure that nobody tries to execute malicious PHP code via a note.
However, you can make your note display as intended. I’d recommend running your note through an HTML encoding tool. (E.g., this one: https://codebeautify.org/html-encode-string).
I copied the note you have above into the tool and confirmed that the output, when pasted in as a new note, renders as expected.
I hope that helps!
Jamie