hoaproject / W3

The W3 repository contains the website of Hoa.
4 stars 8 forks source link

Wrong IRC icon URI on hack book #135

Closed Metalaka closed 7 years ago

Metalaka commented 7 years ago

Originally reported by @lyrixx #134

The URI is https://img.shields.io/badge/help-#hoaproject-ff0066.svg instead of https://img.shields.io/badge/help-hoaproject-ff0066.svg. There is an extra #.

Exemple on: https://hoa-project.net/En/Literature/Hack/Visitor.html

Pierozi commented 7 years ago

Actually is not an extra # It must be urlencode. https://img.shields.io/badge/help-%23hoaproject-ff0066.svg

And the original file is correct => https://raw.githubusercontent.com/hoaproject/Visitor/master/README.md

So, I guess the issue is in the W3 Parser at https://github.com/hoaproject/W3/blob/master/Application/Resource/Literature/Hack.php

Please feel free to submit a PR if you know how to solve this.

Metalaka commented 7 years ago

I found where come from the issue but I don't have much free time currently, so I let someone else continue the job ;)

When parsing a link, CommonMarkConverter decode some entities of the link URI (in our case %23 is decoded to #).

Exemple:

[link](https://img.shields.io/badge/help-%23hoaproject-ff0066.svg)
<a href="https://img.shields.io/badge/help-%23hoaproject-ff0066.svg">link</a>

We have to open an issue on thephpleague/commonmark to see if this behavior is intended or if we can help to fix the library.

Pierozi commented 7 years ago

Thanks @Metalaka, great research :mag:

Hywan commented 7 years ago

Wow… Good work guys!

Hywan commented 7 years ago

I have opened an issue on thephpleague/commonmark.

colinodell commented 7 years ago

This has been fixed in league/commonmark version 0.15.6: https://github.com/thephpleague/commonmark/releases/tag/0.15.6

Hywan commented 7 years ago

Thanks @colinodell!