When trying to create or edit a Wikilink that consists of an anchor or contains an anchor, the anchor will be stripped. Instead it should be retained. The part before the # should also not be changed, it should remain page relative if it currently is.
I think this worked at some point with VE.
Example for what the resulting wikitext should look like (here done without VE as a workaround):
https://www.mediawiki.org/w/index.php?title=Requests_for_comment%2FStreamlining_Composer_usage&type=revision&diff=1910193&oldid=1910187