Let’s take a look at how you can extend the CommonMark converter to make working with links easier and allow you to strikethrough text.

When you want to use links in your Markdown, you would normally use the following syntax:

[Text for the link](https://example.com)

Sometimes you don’t need text for the link. Instead you want the URL itself to be clickable, so you end up doing something like this:

[https://example.com](https://example.com)

Some editors and Markdown parsers, such as GitHub’s one, are smart and will automatically makes URLs clickable in your text. This is known as “autolinking”.

The same thing can be achieved with the CommonMark parser that we have been using in this series.

#php #markdown

Parsing Markdown with PHP: Autolinking and Strikethrough
20.05 GEEK