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

Possibly faulty parsing of close references #159

Open
garazdawi opened this issue Nov 11, 2024 · 4 comments
Open

Possibly faulty parsing of close references #159

garazdawi opened this issue Nov 11, 2024 · 4 comments

Comments

@garazdawi
Copy link
Contributor

The parser seems to think that [a] [b] is the same as [a][b].

iex(1)> EarmarkParser.as_ast "[a] [b]\n[a]: a\n[b]: b"
{:ok, [{"p", [], [{"a", [{"href", "b"}, {"title", ""}], ["a"], %{}}], %{}}], []}

The standard is a bit undecided. Gruber Markdown seems to do the same interpretation as earmark_parser, while github (and in extentions commonmark) thinks that it should be treated as two separate references.

I'm opening this issue to just track the discepency and see if you think we should do something about it.

@RobertDober
Copy link
Owner

Ty Lukas
well I should take this into account when (or rather if) I will ever come to write version 1.5 which aims for more GFM or 2.0 which should be compliant, right now things are looking not good.

But maybe this is a quick fix? I'll keep you posted

garazdawi added a commit to garazdawi/otp that referenced this issue Nov 12, 2024
ex_doc (or rather EarmarkParser) does not consider the
whitespace between reference links significant so joins
multiple references into a single link. Many MD standards
seem to work this way, though the majority do not.

Anyway we need to fix this so that the links render properly,
see RobertDober/earmark_parser#159
for details on when/if this issue is solved.
garazdawi added a commit to garazdawi/otp that referenced this issue Nov 12, 2024
ex_doc (or rather EarmarkParser) does not consider the
whitespace between reference links significant so joins
multiple references into a single link. Many MD standards
seem to work this way, though the majority do not.

Anyway we need to fix this so that the links render properly,
see RobertDober/earmark_parser#159
for details on when/if this issue is solved.
@garazdawi
Copy link
Contributor Author

I noticed it while reading our release notes where we list which issues and PRs a certain change was introduced by. It was an easy fix on our side and the scripts that generate the information have been updated to always insert a comma, so no rush on our end.

@RobertDober
Copy link
Owner

RobertDober commented Nov 12, 2024

Good because while GFM compliance is more or less expected it is always risky to make patch releases which change behviour (on extreme edge case, but still).

Can I close it than? leaving open for further reference

@RobertDober
Copy link
Owner

My bad no, I'll keep it open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants