Get Link from text with multiple links inside

Hey all,

I am having issues getting and editing some anchor tags that are set in a text box.

If you can see on the right-hand side there is an inline reference marked as [1] that is meant to be a link. Currently, this links to a Lightbox. What I would like to do it make sure that my lightbox knows what is being pressed so I can populate it with content.
In other words, I have [1], [2], [3] … on my page, and I would like to use the same lightbox with dynamically loaded content to display a specific reference.

So far I have tried the following:

Reading the HTML inside the text object, but this returns a string, that I would have to somehow parse, edit and parse back. This feels like it’s not the right answer.

Ive been looking in the forum for similar answers and I have found that some people have been able to do this when they are using buttons. I would like to do this but have no clue how to. See example below

import wixWindow from'wix-window'; $.onReady(()=>{
    let receivedData = wixWindow.lightbox.getContext();// will be equal to itemData});
}

A small extra note, there are multiple references in a single text box, so can’t set :

$w(textID).onClick ..... // open Lightbox with data  

Thanks so much in advance!

edit : Title change