Standard Texteditor: Slim Markdown for "domain.tld" -> "<a href="https://domain.tld">domain.tld</a>

Hi.
I like to work with markdown.

There is a very elegant and fast way to to markup mail adresses:

<john@doe.tld>

<a href="mailto:john@doe.tld">john@doe.tld</a>

Is there any way to realize the following or a comparable method, which is slim?

<domain.tld>

<a href="https://domain.tld">domain.tld</a>

Thanks : )

I would suggest to use Kirby tags in the Textarea feild. It is also possible your own tags.

But a Kirby tag has the form “(name: )”.

So it would not be as slim as “<…>” from my example.

In my taste, the ideal solution would be to extend the effect of the “<…>” tag so that it works not only for valid email addresses, but also for valid “subdomain.domain.tld”.
What do you think of this idea?

I tried:

/site/config/config.php:

return [
    'hooks' => [
        'kirbytags:after' => function ($text) {
            // Matches <...> without @ 
            // Allows Paths after the domain, example Telegram-Link<t.me/lorem>)
            return preg_replace(
                '/<([^@<>]+\.[a-zA-Z]{2,}[^<>]*)>(?![^<]*@)/',
                '<a href="https://$1">$1</a>',
                $text
            );
        }
    ]
];

But that destroys the rendering of

(image: 01.jpg alt: Lorem ipsum)

Where does the conversion of

<john@doe.tld>

to

<a href="mailto:john@doe.tld">john@doe.tld</a>

takes place?

In the markdown parser, Parsedown

It is, by the way, not correct IMO, to prepend https:// to every domain name without knowing that the site is secured by a certificate.

Therefore, this “slim” markdown doesn’t really make sense, unless it already uses the protocol.

This:

<https://google.com>

is possible out-of-the-box, but renders as

<a href="https://google.com">https://google.com</a>

I myself can’t remember any websites that don’t offer HTTPS.

Can you think of any relevant ones?

<a href="https://google.com">https://google.com</a>

I think it is more pleasant for the reader if they do not have to read the protocol in the link text.

It’s not a big deal. I’ll just have to find another way to solve my little Markdown task.

Please just take it as a suggestion for the Markdown parser : )

I would even find it useful if telephone numbers could also be marked with “<…>”.

<0123 456789>
<domain.tld>
<john@doe.tld>
All three content types should be easily distinguishable and validatable using RegEx.

The Markdown parser is an external library

Well, be that as it may, a URL that starts with the ftp protocol is also a valid URL. All I wanted to say was that you should not rely on assumptions. If you want to remove the protocol for the link text, you can do so in your code, but I’d I’d enter the full url within the brackets to be on the safe side.

Personally, I like being able to markup standard cases (https) “slim” and only having to markup the rare special cases (ftp) in detail.

But I understand your reservations, Sonja : )

When I replace the standard Markdown editor with another Markdown editor: are there disadvantages to doing so because only the standard Markdown editor can “handle certain things with Kirby”?

At the moment, I am looking for a way to indent and outdent a list item using the tab key.

This is not possible in the standard Markdown editor.

Four spaces are too cumbersome.

With Markdowneditor as a Webapp, using the tab key is possible