geoview-core - v2.3.0
    Preparing search index...

    Function transformMarkdownIds

    • 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})

      Returns string

      The transformed content with prefixed Section IDs

      transformMarkdownIds('<a id="legendSection" href="#layersSection">Link</a>', 'map1-about');
      '<a id="map1-about-legendSection" href="#map1-about-layersSection">Link</a>'