Reformat / Add a div and a class to the image out of kirbytext

How can i add and rewrite the syntax of an image inside the kirbytext. I want to add fancybox and an extra icon etc…

Where can i find the rules for kirbytext? specially the image things? Can i wrote all the new configuaration in config.php?

thanks for help

You can extend/overwrite Kirbytags in a plugin, see the docs: https://getkirby.com/docs/reference/plugins/extensions/kirbytags

The original code for the tags is here: https://github.com/getkirby/kirby/blob/69a948112af8380b9ff6fa0a6ab680136b97777e/config/tags.php#L80