[Pkg-haskell-maintainers] Bug#687453: pandoc: Does not support spaces between () and [] for markdown-style hyperlinks
John MacFarlane
jgm at berkeley.edu
Wed Sep 12 22:29:14 UTC 2012
I believe you are misreading the syntax definition.
Here is the full context for the passage you quote:
> Reference-style links use a second set of square brackets, inside which
> you place a label of your choosing to identify the link:
> This is [an example][id] reference-style link.
>
> You can optionally use a space to separate the sets of brackets:
>
> This is [an example] [id] reference-style link.
>
> Then, anywhere in the document, you define your link label like this,
> on a line by itself:
>
> [id]: http://example.com/ "Optional Title Here"
Note that this concerns only "reference-style links," which use
two sets of square brackets. Links like this
[foo](url)
are not reference-style link, but "inline links." Here is what
the syntax document says about inline links:
> To create an inline link, use a set of regular parentheses immediately
> after the link text’s closing square bracket.
Note: "immediately after," which is most naturally interpreted as
not allowing a space. This interpretation is confirmed by John Gruber's
reference implementation, Markdown.pl, which does not parse
[foo] (url)
as a link, but does allow reference links like
[foo] [bar]
So, to conclude, this does not seem to me to be a bug. Pandoc conforms
to the spec here and agrees with Markdown.pl.
Postscript: I myself think it would make more sense to allow a space in
both inline and reference links. I am just following the spec here. I
note that there is some variation among implementations on this point.
For example, PHP markdown agrees with Gruber's markdown, but my own
peg-markdown does allow the space.
+++ Axel Beckert [Sep 12 12 22:42 ]:
> Package: pandoc
> Version: 1.9.4.2-2
> Severity: minor
>
> Dear Maintainer,
>
> the Markdown hyperlink syntax definition explicitly states "You can
> optionally use a space to separate the sets of brackets", but pandoc's
> Markdown interpreter does not parse such hyperlink definitions.
>
> Example: "[foo] (bar)" get's rendered as "[foo] (bar)" in HTML and
> man/roff output while "[foo](bar)" gets rendered properly as "foo (bar)"
> or '<a href="bar">foo</a>'.
>
> The same problem arises if there's a line break between the two
> bracket pairs, e.g.
>
> (foo)
> [bar]
>
> (which is at least rendered as link by GitHub's Markdown parser, but not
> explicitly stated in the original definition.)
>
> -- System Information:
> Debian Release: wheezy/sid
> APT prefers unstable
> APT policy: (990, 'unstable'), (600, 'testing'), (400, 'stable'), (110, 'experimental')
> Architecture: amd64 (x86_64)
> Foreign Architectures: i386
>
> Kernel: Linux 3.5-trunk-amd64 (SMP w/1 CPU core)
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
>
> Versions of packages pandoc depends on:
> ii libbibutils2 4.12-5
> ii libc6 2.13-35
> ii libffi5 3.0.10-3
> ii libgmp10 2:5.0.5+dfsg-2
> ii libpcre3 1:8.30-5
> ii zlib1g 1:1.2.7.dfsg-13
>
> Versions of packages pandoc recommends:
> pn libghc-citeproc-hs-data <none>
>
> Versions of packages pandoc suggests:
> ii texlive-latex-recommended 2012.20120611-4
> ii texlive-luatex 2012.20120611-4
> ii texlive-xetex 2012.20120611-4
>
> -- no debconf information
>
More information about the Pkg-haskell-maintainers
mailing list