git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] README: create HTTP/HTTPS links from URLs in Markdown

From
EWEric Wong <e@80x24.org>
Date
Mar 2, 2017, 07:57 UTC
Message-ID
<20170302075709.GA6295@starla>
In-Reply-To
<20170302073708.dxm4p24pt6zlqjuz@sigill.intra.peff.net>
Jeff King <peff@peff.net> wrote:
Show 22 quoted lines
> On Thu, Mar 02, 2017 at 07:34:21AM +0000, Eric Wong wrote:
> > Jeff King <peff@peff.net> wrote:
> > > On Wed, Mar 01, 2017 at 10:22:04PM +0000, Eric Wong wrote:
> > > 
> > > > 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.
> > 
> > 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.

> 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)
Previous: Jeff King
Message 5 of 5 in “README: create HTTP/HTTPS links from URLs in Markdown”
  1. README: create HTTP/HTTPS links from URLs in MarkdownEric Wong, Mar 1, 2017
  2. Jeff KingMar 2, 2017
  3. Eric WongMar 2, 2017
  4. Jeff KingMar 2, 2017
  5. Eric WongMar 2, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.