Paste support for link #350

Closed
JakeGinnivan opened this Issue Dec 13, 2012 · 3 comments

Comments

Projects
None yet
3 participants
@JakeGinnivan
Member

JakeGinnivan commented Dec 13, 2012

If I paste a link, I want Markpad to paste it as a markdown link and highlight the alt text. If I paste within the alt text (to make the link text the url), it should just paste the link, not the markdown link

@alexkopy

This comment has been minimized.

Show comment Hide comment
@alexkopy

alexkopy Jan 29, 2013

Is this feasible? I mean I could paste in a massive text block. Should Markpad try-parse everything to see if it's a link? Not to mention that the definition of what is a hyperlink is very complex and no complete regex exists (I think that it's even impossible to have one). So this will be full of heuristics, and thus half working, in turn resulting in constant complains from users about inconsistent behaviour.

All in all, don't think this feature can be created as is. Unless we define "link" the way MS Word does, as something that starts with "http://" and contains no whitespace (though this might still be expensive test if I paste a large body of text).

Is this feasible? I mean I could paste in a massive text block. Should Markpad try-parse everything to see if it's a link? Not to mention that the definition of what is a hyperlink is very complex and no complete regex exists (I think that it's even impossible to have one). So this will be full of heuristics, and thus half working, in turn resulting in constant complains from users about inconsistent behaviour.

All in all, don't think this feature can be created as is. Unless we define "link" the way MS Word does, as something that starts with "http://" and contains no whitespace (though this might still be expensive test if I paste a large body of text).

@shiftkey

This comment has been minimized.

Show comment Hide comment
@shiftkey

shiftkey Jan 29, 2013

Member

I don't think its that hard to find links: http://stackoverflow.com/a/26339/1363815 seems to suggest a reasonable Regex.

Member

shiftkey commented Jan 29, 2013

I don't think its that hard to find links: http://stackoverflow.com/a/26339/1363815 seems to suggest a reasonable Regex.

@alexkopy

This comment has been minimized.

Show comment Hide comment
@alexkopy

alexkopy Jan 29, 2013

Oh, you mean a strictly formatted HTML link, I thought you meant a generic URL. Disregard my concerns then :)

Oh, you mean a strictly formatted HTML link, I thought you meant a generic URL. Disregard my concerns then :)

JakeGinnivan added a commit that referenced this issue Mar 23, 2013

Merge pull request #359 from Shazbot/pasteURL
Feature #350: URL pasting into document
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment