Consider a page Hello that has its display title set to Greetings. What should the following links be rendered as?
[[Hello]]
[[Hello#World]]
[[Hello#World|Hello]]
[[Hello#World|World]]
[[Hello#World|Hello#World]]
[[Hello#World|#World]]
Currently, the link text for those links are rendered as:
[[Hello]]: Greetings
[[Hello#World]]: Greetings
[[Hello#World|Hello]]: Hello
[[Hello#World|World]]: World
[[Hello#World|Hello#World]]: Greetings
[[Hello#World|#World]]: #World
Is that the desired behavior? For example, should [[Hello#World]] and [[Hello#World|Hello#World]] include the anchor in the link text? Should it matter whether the anchor World exists on the page Hello? Are the other links as expected?
Any cases that do not currently have the expected behavior should be fixed, and unit tests should be added to document and test for those choices.