Kirbytext image caption markdown issue

I’m upgrading a site in development form Kirby v2 to v3.

Something has broken that I cannot seem to fix.

In the panel I have a textarea field with the following content.

(image: img_6035.jpg caption: text with *italics*)

When published using <?= $page->text()->kirbytext(); ?> a figure tag appears for the image as I would expect. But the markdown does not work and the result is this:

  <img src="http://localhost:8888/media/pages/support/840203468-1550791454/img_6035.jpg">
  <figcaption>text with *italics*</figcaption>


What I was expecting was this

  <img src="http://localhost:8888/media/pages/support/840203468-1550791454/img_6035.jpg">
  <figcaption>text with <em>italics</em></figcaption>

This did happen as above in v2 so I’m curious if this is a bug or a change in the core that I should try to work around.

Thank you!

Looks like a bug or at least a missing feature to me, Markdown/Kirbytext parsing is not used on the caption.

Wondering if you used a custom image tag in K2 because it seems that Markdown in a caption never worked by default?

I have this working as expected in an older site (Kirby v2.3.2) without plugins. Perhaps it was removed before v3?

That can’t possibly be (and definitely doesn’t work), this is the code in 2.3.2 (and later):

$figure->append('<figcaption>' . html($caption) . '</figcaption>');

No markdown parsing.

Sure you never modified the source code or added a custom image tag? After all these years…

Oh yes. It appears I modified that line, thanks for your patenice. I guess I’m surprised that this functionality wasn’t included all along!

My modified version, for the record:

$figure->append('<figcaption>' . kirbytext($caption) . '</figcaption>');

I looked into making a similar amendment in K3 but couldn’t seem to figure it out. I might go about making a new tag in K3.

Thanks for all your help : )