Transforms guide anchor IDs and hrefs to be unique per map/container instance.
Processes markdown content that contains HTML elements, adding a prefix to
id and href="#..." attributes that end with "Section". This targets only the
custom guide navigation anchors (geolocatorSection, legendSection, etc.) and
avoids false positives on embedded HTML, URLs, or third-party content.
Skips IDs that are already prefixed (idempotent). Does not affect auto-generated
IDs from markdown heading syntax.
Parameters
content: string
Content string containing HTML id and href attributes
prefix: string
The unique prefix (typically {mapId}-{containerType})
Transforms guide anchor IDs and hrefs to be unique per map/container instance.
Processes markdown content that contains HTML elements, adding a prefix to id and href="#..." attributes that end with "Section". This targets only the custom guide navigation anchors (geolocatorSection, legendSection, etc.) and avoids false positives on embedded HTML, URLs, or third-party content.
Skips IDs that are already prefixed (idempotent). Does not affect auto-generated IDs from markdown heading syntax.