xardbaiz / joplin-plugin-hackmd

Quick share notes on HackMD
12 stars 2 forks source link

Fix wrong id selection if note includes a second hackMD link #10

Closed schlagmichdoch closed 6 months ago

schlagmichdoch commented 6 months ago

If a note includes an example link like so:

This is an example for a note. You can find another not on https://hackmd.io/@user/abcdef

End of this note

 ----- 
 HackMD Note URL: https://hackmd.io/@user/fedcba

The added $ ensures that the regex only works if it is at the end of the note. Currently, the id would be abcdef

Better would probably be to save the link into the URL parameter of the note and get rid of the regex entirely.

xardbaiz commented 6 months ago

Thanks for your contribution 🤝

xardbaiz commented 6 months ago

I though about saving HackMD link in URL parameter of note properties(metadata). But this field is used by browser plugin(s) to grab the content and save the origin. Overriding of this field will cause the loss of the info about source