Table of Contents links are not working in the Jupter Notebook preview

Summary

The Jupyter Notebook can include links to headings created as described in this SO answer. However, these do not work in the GitLab preview feature, the tag is printed out instead of hidden and clicking a link in the ToC does not scroll the page to that heading (they also do not work on Github). Example here https://gitlab.com/joelostblom/resources/blob/master/markdown-anchors/markdown-headers.ipynb

Steps to reproduce

See example notebook

This bug happens on GitLab.com