When you browse Wikipedia (English, German, etc.) as a visitor (=not logged in) and click on an entry in the table of contents you get forwarded to an HTML anchor. When you then want to log in to your account you scroll up and click on "Log in" on the upper right corner. MediaWiki redirects you to the log in page. In the URL of the log in page is a parameter called "&returnto=", which redirects you to the previous page after a successful login. But this only redirects you to the previous web page and not to the exact position with the HTML anchor.
Example:
I browse
https://en.wikipedia.org/wiki/Portal_talk:Mathematics#Quantity_and_number
and click on "Log in". Then I get redirected to
https://en.wikipedia.org/w/index.php?title=Special:UserLogin&returnto=Portal+talk%3AMathematics
But the "&returnto=Portal+talk%3AMathematics"-parameter is missing the HTML anchor tag "#Quantity_and_number".
So instead of being redirected to the following page (current status):
https://en.wikipedia.org/w/index.php?title=Special:UserLogin&returnto=Portal+talk%3AMathematics
it would be better if I was redirected to the page with the HTML anchor tag (solution):
https://en.wikipedia.org/w/index.php?title=Special:UserLogin&returnto=Portal+talk%3AMathematics%23Quantity_and_number
In my opinion this should be fixed and the parameter "&returnto=" should use the HTML anchor tag of the previous web page.
I hope you can understand what I see as the problem. If you have any questions just ask me.