Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically convert links to a href's #532

Open
cmdcolin opened this issue Feb 24, 2017 · 1 comment
Open

Automatically convert links to a href's #532

cmdcolin opened this issue Feb 24, 2017 · 1 comment

Comments

@cmdcolin
Copy link

Not sure if this is already supported but it would be great if links in plaintext could automatically converted active with tags

I know github allows this type of thing with their markdown so that would be a cool feature to include

@preaction
Copy link
Owner

preaction commented Feb 24, 2017

It's not already supported, to my knowledge: Markdown has a special syntax to do it, though: <http://example.com>. The angle brackets make the URL inside into a link with the link text being the URL itself. However, I have also been bit by this enough that I wish it just automatically linking anything that looked like a URL (<schema>:<thing>).

There are some surmountable issues:

  • Generally linking anything that matches /[a-z]+:\S+/ would create a lot of false-positives. A good way to reduce this would be to restrict only to some set of URL schemas. What URL <schema> should be supported?
  • I often do things like (http://example.com) expecting it to end up like (<http://example.com>). Some programs I use, though, end up making (<http://example.com)>. We'll want to do this the right way, with a closing paren or bracket not being part of the link if there is a matching opening paren/bracket.

If this is already supported by the Markdown module we use (Text::Markdown), then we should focus our efforts there. Otherwise, we might have to change what Markdown module we use by default. Another option is Text::MultiMarkdown, which is more likely to already support this.

We should also, in the meantime, document how to add <http://example.com> links to content documents in the Statocles content guide. It looks like I have neglected the Links section on that page...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants