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

multiple side by side image links not working #149

Open
RoadRunnr opened this issue May 7, 2024 · 1 comment
Open

multiple side by side image links not working #149

RoadRunnr opened this issue May 7, 2024 · 1 comment
Assignees
Labels
bug Something isn't working low priority

Comments

@RoadRunnr
Copy link

RoadRunnr commented May 7, 2024

#28 through #57 added support and tests for side by side links. However, it did not add a test for side by side link with images as links as are commonly used by badges in GitHub READMEs.

This sample:

[![Crate][crate_img]][crate]
[![Second][second_img]][second]

[crate]:       crate_url "Link"
[crate_img]:   crate_image_url "Image"
[second]:       second_url "Link"
[second_img]:   second_image_url "Image"

Renders on GH to the correct:

<p dir="auto">
  <a href="crate_url" title="Link"><img src="crate_image_url" alt="Crate" title="Image" style="max-width: 100%;"></a>
  <a href="second_url" title="Link"><img src="second_image_url" alt="Second" title="Image" style="max-width: 100%;"></a>
</p>

However, earmark parses it to:

[
   {
     "p",
     [],
     [
       {
         "a",
         [{"href", "second_url"}, {"title", "Link"}],
         [{"img", [{"src", "crate_url"}, {"alt", "Crate][crate_img]"}, {"title", "Link"}], [], %{}}, "\n[", {"img", [{"src", "second_image_url"}, {"alt", "Second"}, {"title", "Image"}], [], %{}}],
         %{}
       }
     ],
     %{}
   }
 
@RobertDober
Copy link
Owner

Ty for this report

I have not seen this syntax used yet with images, and the problem has never been reported before.
I will not close this yet but it will be low priority in the current context. Can you work with this
syntax?

[![Hex.pm](https://img.shields.io/hexpm/v/earmark_parser.svg)](https://hex.pm/packages/earmark_parser)

@RobertDober RobertDober self-assigned this May 10, 2024
@RobertDober RobertDober added bug Something isn't working low priority labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low priority
Projects
None yet
Development

No branches or pull requests

2 participants