Controlling file link in text block

hi, i’m using photoswipe to show images in a lightbox. therefore i would like to custumize the way, kirby renders the file links in a text block. if i link a file in a text block, the output in the content file is
<a href=\"/@/file/qdixblr1Rdy4lRse\">link</a>
but i would like it to be sth like:
<div class="lightbox"><a href="<?= $image->url() ?>" data-pswp-width="<?= $image->width() ?>" data-pswp-height="<?= $image->height() ?>">link</a>
where can i customize that? i already created a new file called text.php in the snippets>blocks folder but i’m not quite sure what to put in…

also i would like to know where i can edit the link dialog. i don’t need the “In neuem Fenster öffnen” checkbox.

thank you very much

Hm, you would have to modify the HTML, but putting a div in the middle of a paragraph would result in invalid html

can be a span too

how would i modify the html?
thanks

Basically with a preg_replace_all() for a given pattern.