Hi there, what about simply using AnchorJS e.g. like this?
require.config({ paths: { 'AnchorJS': 'https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.3.1/anchor' } }); require(['AnchorJS'], function(AnchorJS) { const anchors = new AnchorJS(); anchors.add('.wikigeneratedid'); });
At the first sight, it seems to work just fine. Tested in XWiki 15.10.8.