Comments (7)
I confirm that new feature works as desired in MM v3.3.2. Thank you!
from markdownmonster.
What are you doing exactly to capture the link to the clipboard?
Are you copying the Html link to the clipboard by selecting the Link text in the HTML?
What I see is:
- If you copy the link text in HTML
- HTML Clipboard with the full href link (ie. link and text that can be parsed)
- Text with just the link text
- If you Copy Link Address from context menu
- Html is null
- Link Address
So, I could check for HTML on the clipboard and if it follows the plain link pattern extract the link and use the text.
from markdownmonster.
What is copied depends on the browser and on the context within the browser. For example when you copy a link in a webpage or a bookmark using Firefox then the clipboard contains a proper HTML link. However when you copy the URL from the URL bar then only the URL is captured. Edge always copies just the URL regardless of the context. So yes, you have to check whether the clipboard contains HTML or only plain text.
from markdownmonster.
Yes I see - options too. I'm using Brave and it doesn't do the HTML linking, but Edge does. I might have turned this off because frankly that feature is really annoying as it causes some weird issues if you paste into an app that doesn't explicitly support the links (visual editors mainly).
Implementation is easy enough, but I'm not sure how useful this is. In 90% of cases you're going to be selecting some text, then press Ctrl-K to add the link. If you have selected text this type of pasting should not replace what was selected. It would only apply if you Ctrl-K with no selection which I can't remember EVER doing in any application ๐ Even if you don't do it, more frequently than not the title contains crap that's not really usable like the site name, or other context info that's not useful in a link.
Perfectly good example is the link text for this page:
Feature Request: Improve Embed Link dialog (
Ctrl+K
) when clipboard contains HTML link ยท Issue #1121
Probably not what you'd use for link text...
from markdownmonster.
Added:
from markdownmonster.
Yes I see - options too. I'm using Brave and it doesn't do the HTML linking, but Edge does. I might have turned this off because frankly that feature is really annoying as it causes some weird issues if you paste into an app that doesn't explicitly support the links (visual editors mainly).
To my vague understanding an app can copy data to the clipboard in multiple formats simultaneously. A HTML link is supposed to be copied in two formats. Firstly the URL should always be copied as plain text and secondly the full link (URL and description) could be copied as HTML text. Simple apps will see only the primary format if it is plain text, otherwise the clipboard appears empty to them. However, more complex apps like the apps of LibreOffice or Microsoft Office check for other formats.
... In 90% of cases you're going to be selecting some text, then press Ctrl-K to add the link.
The percentage of this use case varies greatly. I would say on average it makes about 75% for me and the absolute daily occurrence count is considerable.
If you have selected text this type of pasting should not replace what was selected. It would only apply if you Ctrl-K with no selection which I can't remember EVER doing in any application ?? Even if you don't do it, more frequently than not the title contains crap that's not really usable like the site name, or other context info that's not useful in a link.
I agree that the selected text should have higher priority than the link text in the HTML link. I also agree that the original link text sometimes needs to be adjusted, but usually it is easier to delete some parts you don't want than to type all the text you want. Furthermore often I use a bookmark that I want to keep anyway. So I clean its description before I copy the bookmark and paste it into a document of any type (not just Markdown).
Do you access the clipboard from C# or JavaScript?
from markdownmonster.
The clipboard data comes from C# and I can get at the HTML (not supported directly, but I have clipboard helpers that get it as it's used for other things in MM - like Paste HTML as Markdown).
IAC, take a look in 3.3.2 - I think what's there now is good to go.
from markdownmonster.
Related Issues (20)
- Right-clicking a file should not open, should only show context menu HOT 7
- Repeated ctrl-f or ctrl-h should jump to next occurrence HOT 8
- Can open file multiple times HOT 5
- FB refresh icon shows selected when unselecting FB sync HOT 1
- Have a way to keep read-only files open in tabs (pin?) HOT 2
- Regression: mouse drag errors? HOT 1
- Different context menu after first opening MM HOT 1
- Renaminng renames wrong file HOT 2
- Problems with HTML preview HOT 2
- Already solved... HOT 1
- Preview window always opens HOT 4
- Inconsistency in alert colors between the Github and Github Dark themes. HOT 8
- Error in UI HOT 1
- AI Feature: AI Request Failed invalid uri HOT 2
- Prevent empty copy/cut from overwriting paste buffer HOT 2
- Renaming file opens empty file and empty bak files HOT 1
- It is very frustrating that every time you start `MM` and exit `MM`, `MM` initializes the settings file causing user settings to be lost. HOT 7
- Unable to paste image from clipboard HOT 3
- Feature Request: Add Copy Image to Clipboard for Mermaid diagrams HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from markdownmonster.