I have a page whose content is inside the Numbered Headings macro, and this is preceded by a ToC macro. I want to improve the internal page navigation by converting text references to other sections into links. I understand that I can add links in the form #MyHeading, but how do I discover what #MyHeading is for a particular heading? It's easy for single-word headings but what about multi-word headings, some containing punctuation ('-', '&', '(', ')')?
I've tried extracting the #MyHeading from the ToC result, which worked but would be rather tedious for multiple links. It would be convenient to be able to search within #MyHeadings for the current page.