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

Side by side reference style links not working #28

Closed
kianmeng opened this issue Nov 3, 2020 · 5 comments
Closed

Side by side reference style links not working #28

kianmeng opened this issue Nov 3, 2020 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@kianmeng
Copy link
Contributor

kianmeng commented Nov 3, 2020

Not sure this is a bug or missing configuration. But side by side reference style links not working as intended while adjusting the HTML doc for OldhamMade/TeslaCacher#1.

Sample markdown.

[![Build Status](https://travis-ci.org/OldhamMade/TeslaCacher.svg?branch=main)][TravisCI] 
[![Module Version](https://img.shields.io/hexpm/v/tesla_cacher.svg)][ModuleVersion]

...

[TravisCI]: https://travis-ci.org/OldhamMade/TeslaCacher
[ModuleVersion]: https://hex.pm/packages/tesla_cacher 

Expected (as rendered in VSCode).

image

Actual (as generated by EarMarkParser through ex_doc).

image

@RobertDober
Copy link
Owner

@RobertDober
Copy link
Owner

I really have to look at this. Ad hoc I do not believe this is an error but in order to check I would like you to give me the expected html output, images are just not very useful. Thanx

@myrrlyn
Copy link
Contributor

myrrlyn commented Mar 18, 2021

I am encountering behavior similar to this. Babelmark link

Versions:

  • earmark: 1.4.14
  • earmark_parser: 1.4.12

Markdown:

Correct

[![](https://img.shields.io/crates/v/calm_io.svg)](https://crates.io/crates/calm_io)
[![](https://docs.rs/calm_io/badge.svg)](https://docs.rs/calm_io)
[![](https://img.shields.io/crates/l/calm_io.svg)](https://github.com/myrrlyn/calm_io/blob/master/LICENSE.txt)
[![](https://img.shields.io/crates/dv/calm_io.svg)](https://crates.io/crates/calm_io)
[![](https://tokei.rs/b1/github/myrrlyn/calm_io?category=code)](https://github.com/myrrlyn/calm_io)

Incorrect

[![Crate][crate_img]][crate]
[![Documentation][docs_img]][docs]
[![License][license_img]][license]
[![Crate Downloads][dl_img]][crate]
[![Crate Size][loc_img]][source]

[crate]:       https://crates.io/crates/calm_io "Crate Link"
[crate_img]:   https://img.shields.io/crates/v/calm_io.svg "Crate Version Display"
[dl_img]:      https://img.shields.io/crates/dv/calm_io.svg "Download Counter"
[docs]:        https://docs.rs/calm_io "Documentation Link"
[docs_img]:    https://docs.rs/calm_io/badge.svg "Documentation Display"
[license]:     https://github.com/myrrlyn/calm_io/blob/master/LICENSE.txt "License"
[license_img]: https://img.shields.io/crates/l/calm_io.svg "License Display"
[loc_img]:     https://tokei.rs/b1/github/myrrlyn/calm_io?category=code "Repository Size"
[source]:      https://github.com/myrrlyn/calm_io "Source Code"

Rendered:

rendered

HTML output:

<p> Correct </p>
<p>
  <a href="https://crates.io/crates/calm_io"> <img src="https://img.shields.io/crates/v/calm_io.svg" alt=""> </a>
  <a href="https://docs.rs/calm_io"> <img src="https://docs.rs/calm_io/badge.svg" alt=""> </a>
  <a href="https://github.com/myrrlyn/calm_io/blob/master/LICENSE.txt"> <img src="https://img.shields.io/crates/l/calm_io.svg" alt=""> </a>
  <a href="https://crates.io/crates/calm_io"> <img src="https://img.shields.io/crates/dv/calm_io.svg" alt=""> </a>
  <a href="https://github.com/myrrlyn/calm_io"> <img src="https://tokei.rs/b1/github/myrrlyn/calm_io?category=code" alt=""> </a>
</p>
<p> Incorrect </p>
<p>
  <a href="https://github.com/myrrlyn/calm_io" title="Source Code">!</a><a href="https://crates.io/crates/calm_io" title="Crate Link">Crate]</a>
  <a href="https://github.com/myrrlyn/calm_io/blob/master/LICENSE.txt" title="License">crate_img]]</a>
  <a href="https://docs.rs/calm_io" title="Documentation Link">crate]
[  <img src="https://docs.rs/calm_io/badge.svg" alt="Documentation" title="Documentation Display">
</a>
[  <img src="https://img.shields.io/crates/l/calm_io.svg" alt="License" title="License Display">

[  <img src="https://img.shields.io/crates/dv/calm_io.svg" alt="Crate Downloads" title="Download Counter">

[  <img src="https://tokei.rs/b1/github/myrrlyn/calm_io?category=code" alt="Crate Size" title="Repository Size">
</p>

AST output:

{:ok,
 [
   {"p", [], ["Correct"], %{}},
   {"p", [],
    [
      {"a", [{"href", "https://crates.io/crates/calm_io"}],
       [{"img", [{"src", "https://img.shields.io/crates/v/calm_io.svg"}, {"alt", ""}], [], %{}}],
       %{}},
      "\n",
      {"a", [{"href", "https://docs.rs/calm_io"}],
       [{"img", [{"src", "https://docs.rs/calm_io/badge.svg"}, {"alt", ""}], [], %{}}], %{}},
      "\n",
      {"a", [{"href", "https://github.com/myrrlyn/calm_io/blob/master/LICENSE.txt"}],
       [{"img", [{"src", "https://img.shields.io/crates/l/calm_io.svg"}, {"alt", ""}], [], %{}}],
       %{}},
      "\n",
      {"a", [{"href", "https://crates.io/crates/calm_io"}],
       [{"img", [{"src", "https://img.shields.io/crates/dv/calm_io.svg"}, {"alt", ""}], [], %{}}],
       %{}},
      "\n",
      {"a", [{"href", "https://github.com/myrrlyn/calm_io"}],
       [
         {"img",
          [{"src", "https://tokei.rs/b1/github/myrrlyn/calm_io?category=code"}, {"alt", ""}], [],
          %{}}
       ], %{}}
    ], %{}},
   {"p", [], ["Incorrect"], %{}},
   {"p", [],
    [
      {"a", [{"href", "https://github.com/myrrlyn/calm_io"}, {"title", "Source Code"}],
       [
         "!",
         {"a", [{"href", "https://crates.io/crates/calm_io"}, {"title", "Crate Link"}],
          [
            "Crate]",
            {"a",
             [
               {"href", "https://github.com/myrrlyn/calm_io/blob/master/LICENSE.txt"},
               {"title", "License"}
             ],
             [
               "crate_img]]",
               {"a", [{"href", "https://docs.rs/calm_io"}, {"title", "Documentation Link"}],
                [
                  "crate]\n[",
                  {"img",
                   [
                     {"src", "https://docs.rs/calm_io/badge.svg"},
                     {"alt", "Documentation"},
                     {"title", "Documentation Display"}
                   ], [], %{}}
                ], %{}},
               "\n[",
               {"img",
                [
                  {"src", "https://img.shields.io/crates/l/calm_io.svg"},
                  {"alt", "License"},
                  {"title", "License Display"}
                ], [], %{}}
             ], %{}},
            "\n[",
            {"img",
             [
               {"src", "https://img.shields.io/crates/dv/calm_io.svg"},
               {"alt", "Crate Downloads"},
               {"title", "Download Counter"}
             ], [], %{}}
          ], %{}},
         "\n[",
         {"img",
          [
            {"src", "https://tokei.rs/b1/github/myrrlyn/calm_io?category=code"},
            {"alt", "Crate Size"},
            {"title", "Repository Size"}
          ], [], %{}}
       ], %{}}
    ], %{}}
 ], []}

I hope this is sufficient information. Please let me know if there is anything more I can provide. Also, thank you for your work on this library!


Addendum: presence or absence of the link title (path "text") or [ref]: path "text" does not change this behavior; I elided the link title when rewriting from incorrectly-rendered to correctly-rendered for expediency, and just want to note that it is experimentally irrelevant to the actual bug.

@RobertDober RobertDober added bug Something isn't working help wanted Extra attention is needed PR validated and removed under investigation PR validated bug Something isn't working help wanted Extra attention is needed labels Apr 10, 2021
@RobertDober
Copy link
Owner

Hello @myrrlyn and sorry for the late reply, your Babelmark link is appreciated and the information is sufficient.
Thank you

@RobertDober RobertDober added the bug Something isn't working label Aug 26, 2021
@RobertDober RobertDober added this to the 1.4.16 milestone Aug 26, 2021
@RobertDober RobertDober modified the milestones: 1.4.16, 1.4.17 Oct 7, 2021
RobertDober added a commit that referenced this issue Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants