Currently, the scroll to location hash is broken due to vitepress doing the scroll before the Switch.vue component has had time to update the global classes that control the visibility of reason and ocaml blocks.
The PR adds a small script that mostly reproduces what Switch.vue is doing, but does so after DOMContentLoaded event, so when vitepress runs the scroll to hash logic, the content is already in its right position.
Currently, the scroll to location hash is broken due to vitepress doing the scroll before the
Switch.vue
component has had time to update the global classes that control the visibility ofreason
andocaml
blocks.The PR adds a small script that mostly reproduces what
Switch.vue
is doing, but does so afterDOMContentLoaded
event, so when vitepress runs the scroll to hash logic, the content is already in its right position.cc @feihong