How can I get the text in beforeCursorEnter handler of a Textmarker

I have many TextMarkers in a doc, and I want to show a modal for the user to re-edit the text when the user clicks the TextMarker.

To achieve this, I find beforeCursorEnter in the manual.
I would bind a event handler, say showModal, for each TextMarker.
But beforeCursorEnter does not provide the TextMarker instance to the event handler.

I guess I can use doc.findMarksAt to solve my problem.