Like the new Title.newFromImg method a method to get the Title object for a link or its href attribute would be very useful. Such a function would have to:
- Check that the link is a local link.
- Get the title either from the title parameter or from the path.
- Unescape it and create a title object.
Currently gadgets that need to determine the title for a given link mostly use the title attribute of the link (and temporarily broke on bug 542, and regularly break if other gadgets change the title, and don't work for missing pages, which have a "page does not exist" in the title). Having a function that takes care to get everything right would help very much in programming gadgets, and would make bug 38598 comment 3 really true.