The line in the markdown file where the HTML element is located

Hello! I have a checkbox defined through a markdown file (there is a line - [ ] in the source file). This checkbox is displayed as an HTML element, and I catch this event via registerDomEvent(). Then I need to find out on which line of the original markdown file this checkbox was located (to insert text into this line). How can I do this?