Ref T13410. We currently generate some less-than-ideal anchors in remarkup, but it's hard to change the algorithm without breaking stuff.
To mitigate this, allow #xyz to match any target on the page which begins with xyz. This means we can make anchors longer with no damage, and savvy users are free to shorten anchors to produce more presentation-friendly links.