Moved to Azure and Markdown for Images Won't Load

I am in process of moving to Azure and everything loads up fine except kirbytext markdown is not parsing. Below is the syntax.

<?php echo $page->promotion2image()->kirbytext()?>

And it is outputting the text instead of the image.

(image: 0322_rv_getoutplay_webfront.jpg alt:RV and Motorcycle on Road)

Does this only affect the image KirbyTag and all other tags work?

Yep, seems to be the only thing affected.

That is rather weird. Have you overwritten the image KirbyTag?

To clarify: The site is working fine locally or on another remote server?

It looks like I was overwriting it with a plugin but it worked on the other hosting. The only difference I see is the php versions are 7.4.28 and 7.4.32. Interesting.

Could you post the code for your image Kirbytag? Might be an issue with PHP extensions being enabled or not in different PHP versions.

It looks like this code was updated here. Quicktip: Reusing KirbyTags in custom tags | Kirby CMS after I updated it to the 2nd example it’s working now.

Below is what I was using that didn’t work.


$originalTag = Kirby\Text\KirbyTag::$types['image'];
Kirby::plugin('your/plugin', [
    'tags' => [
        'image' => [
            'attr' => array_merge(

            'html' => function($tag) use ($originalTag)  {

                $file = $tag->file($tag->value());

                // gets srcset array from config
                $presets = option('thumbs.srcsets.default');

                // sets srcset as kirbytag array with fallback to config array
                $srcset = $tag->srcset ? explode(',', $tag->srcset): $presets;
                // casts kirbytext array strings to ints
                $srcset = array_map(function($item) {
                    return (int) $item;
                }, $srcset);

                $result = $originalTag['html']($tag);

                if (! $file === true || is_null($srcset) === true) {
                    return $result;

                $pattern = '/<img.*?>/i';

            // build a new image tag with the srcset
            $image = Html::img($tag->src, [
                'width' => $tag->width,
                'height' => $tag->height,
                'class' => $tag->imgclass,
                'title' => $tag->title,
                'alt' => $tag->alt ?? ' ',
                'srcset' => $file->srcset($srcset),

            // replace the old image tag
            $result = preg_replace($pattern, $image , $result);

            return $result;