Skip to contentSkip to conversation

README: create HTTP/HTTPS links from URLs in Markdown

PATCH In review Eric Wong 2 participants 5 messages Mar 1, 2017 – Mar 2, 2017

lore
Share & tools
lore

Eric Wong

author
#0 lore raw

PATCH 1/1 README: create HTTP/HTTPS links from URLs in Markdown

Markdown supports automatic links by surrounding URLs with angle brackets, as documented in
<https://daringfireball.net/projects/markdown/syntax#autolink>

While we're at it, update URLs to avoid redirecting clients for git-scm.com (by using HTTPS) and public-inbox.org (by adding a trailing slash).

---
I was going to cite some style manuals (MLA, APA, etc), but it seems current versions do not favor angle brackets. However, this remains consistent with the recommendations in RFC 2369 <https://ietf.org/rfc/rfc2369.txt> for mail headers.

 README.md | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
README.md +3 -3
index c0cd5580e..f17af66a9 100644
@@ -12,7 +12,7 @@ Torvalds with help of a group of hackers around the net.
 
 Please read the file [INSTALL][] for installation instructions.
 
-Many Git online resources are accessible from http://git-scm.com/
+Many Git online resources are accessible from <https://git-scm.com/>
 including full documentation and Git related tools.
 
 See [Documentation/gittutorial.txt][] to get started, then see
@@ -33,8 +33,8 @@ requests, comments and patches to [email protected] (read
 [Documentation/SubmittingPatches][] for instructions on patch submission).
 To subscribe to the list, send an email with just "subscribe git" in
 the body to [email protected]. The mailing list archives are
-available at https://public-inbox.org/git,
-http://marc.info/?l=git and other archival sites.
+available at <https://public-inbox.org/git/>,
+<http://marc.info/?l=git> and other archival sites.
 
 The maintainer frequently sends the "What's cooking" reports that
 list the current status of various development topics to the mailing
Signature · 1 line
EW
#1 lore raw
Quoted 3 lines · Eric Wong

Markdown supports automatic links by surrounding URLs with angle brackets, as documented in
<https://daringfireball.net/projects/markdown/syntax#autolink>

One of the joys of markdown is that there are so many variants. A lot of them (including GitHub-flavored markdown) will linkify URLs even when they're not inside angle brackets.

So I don't mind this patch, but I'm curious what's rendering the markdown you're seeing. I'd think online that one would either come across the raw text, or the GFM from https://github.com/git/git.

-Peff

author
#2 lore raw
Quoted 6 lines · Jeff King
Quoted 3 lines · Eric Wong

Markdown supports automatic links by surrounding URLs with angle brackets, as documented in
<https://daringfireball.net/projects/markdown/syntax#autolink>

Quoted 7 lines

One of the joys of markdown is that there are so many variants. A lot of them (including GitHub-flavored markdown) will linkify URLs even when they're not inside angle brackets.

So I don't mind this patch, but I'm curious what's rendering the markdown you're seeing. I'd think online that one would either come across the raw text, or the GFM from https://github.com/git/git.

I was using Gruber's reference implementation from Debian stable (1.0.1-7).

Also, pandoc (also Debian stable 1.12.4.2~dfsg-1+b14) seems to require angle brackets by default. pandoc also supports the "-f markdown_github" option where it seems to behave like GFM.

But yeah, I much prefer the unambiguity of angle brackets, especially when URLs are followed immediately but punctuation such as ',' or '.'.

#3 lore raw
Quoted 11 lines · Eric Wong
Quoted 10 lines · Jeff King
Quoted 3 lines · Eric Wong

Markdown supports automatic links by surrounding URLs with angle brackets, as documented in
<https://daringfireball.net/projects/markdown/syntax#autolink>

One of the joys of markdown is that there are so many variants. A lot of them (including GitHub-flavored markdown) will linkify URLs even when they're not inside angle brackets.

Quoted 6 lines
Quoted 3 lines

So I don't mind this patch, but I'm curious what's rendering the markdown you're seeing. I'd think online that one would either come across the raw text, or the GFM from https://github.com/git/git.

I was using Gruber's reference implementation from Debian stable (1.0.1-7).

OK. I guess my question more was "why are you doing that?". I'd expect people to find the GFM rendering on GitHub, or just look at the text via "less".

But it's not really my business why you would want to do it. :) It's reasonable for us to cater to the common subset of renderers.

-Peff

author
#4 lore raw
Quoted 16 lines · Jeff King
Quoted 15 lines · Eric Wong
Quoted 13 lines · Jeff King
Quoted 3 lines · Eric Wong

Markdown supports automatic links by surrounding URLs with angle brackets, as documented in
<https://daringfireball.net/projects/markdown/syntax#autolink>

One of the joys of markdown is that there are so many variants. A lot of them (including GitHub-flavored markdown) will linkify URLs even when they're not inside angle brackets.

So I don't mind this patch, but I'm curious what's rendering the markdown you're seeing. I'd think online that one would either come across the raw text, or the GFM from https://github.com/git/git.

Quoted 6 lines
Quoted 2 lines

I was using Gruber's reference implementation from Debian stable (1.0.1-7).

OK. I guess my question more was "why are you doing that?". I'd expect people to find the GFM rendering on GitHub, or just look at the text via "less".

Actually, I was initially seeing the lack of trailing slash causing unnecessary 301 redirects on public-inbox.org.

So, I added the trailing slash and ran "markdown <README.md" to check my work.

Then, I realized links weren't generated at all without angle brackets. So down the rabbit hole I went to read Gruber's syntax document and linkifying the rest for compatibility with Gruber's implementation.

Quoted 2 lines

But it's not really my business why you would want to do it. :) It's reasonable for us to cater to the common subset of renderers.

:)

I figure somebody unfamiliar with Markdown editing README.md is likely to run the original implementation locally to check their work, as I did.

(hmm... and vger is unusually slow this week)