thephpleague / html-to-markdown

Convert HTML to Markdown with PHP
MIT License
1.77k stars 205 forks source link

Force link style option #187

Closed fveltmann closed 4 years ago

fveltmann commented 4 years ago

Would be great to have an option to force a link style. For example this: [link]()

So that even links where the descriptions and the URI are equal are parsed in this style and not like this: \<link>

colinodell commented 4 years ago

I like that idea. Perhaps call the option something like use_autolinks - if true (default), use <...> syntax where applicable; if false, always use the longer/full link syntax.

digilist commented 4 years ago

For links without any text it's also quite common to just write down the link without any "syntax". Most websites and tools transform it then automatically into a clickable link. I know this is not specified in the commonmark, but I would prefer such an option. Maybe also worth considering? :relaxed:

fveltmann commented 4 years ago

@colinodell Can you estimate when this feature will be implemented?

colinodell commented 4 years ago

I unfortunately don't have an ETA on this feature as my focus is primarily on league/commonmark 2.0 right now. If anyone in the community would like to implement this feature and send a PR I will gladly review, merge, and release it!

Tar-Minyatur commented 4 years ago

Looked easy enough to do, so I gave it a shot (#188). Without concrete examples in here I'm not 100% sure I hit the spot though.

colinodell commented 4 years ago

This has been implemented and released in 4.10.0! :tada: