Extract the Wagtail directives from the URL fragment.
This follows the algorithm described in https://wicg.github.io/scroll-to-text-fragment/#extracting-the-fragment-directive for extracting the fragment directive from the URL fragment, with a few differences:
a string of Wagtail directives, if any, in the style of URL search parameters.
window.location.hash = '#:w:contentpath=abc1.d2e.3f'// getWagtailDirectives() === 'contentpath=abc1.d2e.3f' Copy
window.location.hash = '#:w:contentpath=abc1.d2e.3f'// getWagtailDirectives() === 'contentpath=abc1.d2e.3f'
window.location.hash = '#an-anchor:w:contentpath=abc1.d2e.3f'// getWagtailDirectives() === 'contentpath=abc1.d2e.3f' Copy
window.location.hash = '#an-anchor:w:contentpath=abc1.d2e.3f'// getWagtailDirectives() === 'contentpath=abc1.d2e.3f'
window.location.hash = '#hello:w:contentpath=abc1.d2e.3f&unknown=123&unknown=456'// getWagtailDirectives() === 'contentpath=abc1.d2e.3f&unknown=123&unknown=456' Copy
window.location.hash = '#hello:w:contentpath=abc1.d2e.3f&unknown=123&unknown=456'// getWagtailDirectives() === 'contentpath=abc1.d2e.3f&unknown=123&unknown=456'
Extract the Wagtail directives from the URL fragment.
This follows the algorithm described in https://wicg.github.io/scroll-to-text-fragment/#extracting-the-fragment-directive for extracting the fragment directive from the URL fragment, with a few differences: