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

Autolink support without <...> #12

Closed
colinodell opened this issue Jan 10, 2018 · 8 comments
Closed

Autolink support without <...> #12

colinodell opened this issue Jan 10, 2018 · 8 comments
Assignees

Comments

@colinodell
Copy link
Member

See thephpleague/commonmark#308

@tankerkiller125
Copy link

tankerkiller125 commented Jan 10, 2018

Have a look at OSSchools/commonmark-ext to see how I've done this. You can pretty much copy it although you'll need to remove the URLMeta stuff (automatic titling of links based on webpage title)

I should also mention that there is code for strike though support in that repo as well for #6

@markhalliwell
Copy link

Their approach of using an inline parser seems... really expensive. It's literally matching ever alphanumeric character and then doing a regexp check on... everything.

I think it would make more sense to implement a DocumentProcessorInterface extension after all is said and done to do a global match and replace for any remaining stragglers that haven't been caught.

@glensc
Copy link
Contributor

glensc commented Mar 13, 2019

@tankerkiller125 OSSchools/commonmark-ext seems to do too much and adding unwanted dependencies:

  • laravel/framework
  • mpratt/embera

I don't want markdown rendering library have code to fetch remotes via curl. violates single responsibility principle.

@glensc
Copy link
Contributor

glensc commented Mar 13, 2019

@colinodell maybe you want(can, please!?:) to create single purpose supported version under thephpleague to handle this kind of problem, like you did for thephpleague/commonmark-ext-smartpunct and thephpleague/commonmark-ext-inlines-only

i have this in checklist to transition to commonmark:

@colinodell
Copy link
Member Author

Yep I will work on creating this. I'll either be following @MarkCarver's suggestion or thephpleague/commonmark#345 if that seems to be viable

@glensc
Copy link
Contributor

glensc commented Mar 13, 2019

I think the big end goal would be to have GFM (GitHub Flavored Markdown / GitLab Flavored Markdown) enable-able with single extension:

currently picking features one by one while just want what people are accustomed for, and that's GFM!

@tankerkiller125
Copy link

@glensc That package was designed specifically for the core project they were built, hence the Laravel requirements and other requirements. The actual code for the auto-linking however did not require those extra dependencies.

@colinodell
Copy link
Member Author

This has been implemented via https://github.com/thephpleague/commonmark-ext-autolink/blob/v0.1.0/src/AutolinkExtension.php. We'll pull it into here as a dependency.

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

No branches or pull requests

4 participants