The plugin mentioned by @Erisred already can do most of this. I’d suggest making a request in that repo for the case when there is no text selected.
Alternatively, you can use any of the markdown clippers mentioned here: How do I get content from websites into my notes?
Some of them offer the functionality to copy as markdown links.