pragdave / earmark

Markdown parser for Elixir
Other
857 stars 135 forks source link

Multiple images with links are not parsed correctly #457

Closed eproxus closed 1 year ago

eproxus commented 1 year ago

When using markdown images with links, ex_doc incorrectly parses them when they are in one paragraph.

Input

[![Travis][travis badge]][travis]
[![Hex.pm Version][hex version badge]][hex]
[![Hex.pm License][hex license badge]][hex]
[![Erlang Versions][erlang version badge]][travis]
[![Build Tool][build tool]][hex]
[![Donations][liberapay badge]][liberapay]

...

<!-- Badges -->
[travis]: https://travis-ci.org/eproxus/unite
[travis badge]: https://img.shields.io/travis/eproxus/unite/master.svg?style=flat-square
[hex]: https://hex.pm/packages/unite
[hex version badge]: https://img.shields.io/hexpm/v/unite.svg?style=flat-square
[hex license badge]: https://img.shields.io/hexpm/l/unite.svg?style=flat-square
[erlang version badge]: https://img.shields.io/badge/erlang-21%20to%2024-blue.svg?style=flat-square
[build tool]: https://img.shields.io/badge/build%20tool-rebar3-orange.svg?style=flat-square
[liberapay badge]: https://img.shields.io/liberapay/receives/eproxus.svg?logo=liberapay&style=flat-square
[liberapay]: https://liberapay.com/eproxus/

Full example: https://github.com/eproxus/unite/blob/v0.4.0/README.md

Result

Screenshot 2022-11-29 at 12 04 55

HTML

<p><a href="https://liberapay.com/eproxus/" title="" class="no-underline"><img src="https://hex.pm/packages/unite" alt="Travis][travis badge]][travis]
[![Hex.pm Version][hex version badge]][hex]
[![Hex.pm License][hex license badge]][hex]
[![Erlang Versions][erlang version badge]][travis]
[![Build Tool][build tool]" title="">
[<img src="https://img.shields.io/liberapay/receives/eproxus.svg?logo=liberapay&amp;style=flat-square" alt="Donations" title=""></a></p>

Expected

As rendered on GitHub, a bunch of images on one line in a paragraph:

Screenshot 2022-11-29 at 12 08 25
eproxus commented 1 year ago

See https://github.com/elixir-lang/ex_doc/issues/1635

RobertDober commented 1 year ago

This is a parser issue

RobertDober commented 1 year ago

@eproxus thank you for reporting this I will open the issue in the parser