Skip to content
This repository has been archived by the owner on Apr 4, 2020. It is now read-only.

Makes double links for <https://example.com/> #12

Closed
imliam opened this issue Jun 17, 2019 · 1 comment
Closed

Makes double links for <https://example.com/> #12

imliam opened this issue Jun 17, 2019 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@imliam
Copy link

imliam commented Jun 17, 2019

This extension does not take into account existing inline links surrounded by angle brackets, such as <https://example.com/> - this causes them to get doubled up with an anchor tag inside another anchor tag.

$environment = \League\CommonMark\Environment::createCommonMarkEnvironment()
    ->addExtension(new \League\CommonMark\Ext\Autolink\AutolinkExtension());

$commonMarkConverter = new \League\CommonMark\CommonMarkConverter([], $environment);

$commonMarkConverter->convertToHtml('<https://example.com/>');

// Expected: '<p><a href="https://example.com/">https://example.com/</a></p>'

// Actual: '<p><a href="https://example.com/"><a href="https://example.com/">https://example.com/</a></a></p>'
@colinodell colinodell self-assigned this Jun 17, 2019
@colinodell colinodell added the bug Something isn't working label Jun 17, 2019
@colinodell
Copy link
Member

Oops, good catch! I have released v0.3.1 and v1.0.0-beta3 with a fix. Thank you for reporting this!

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants