Implement support for simplified linking inside same document.

[text][#section] becomes [text][current_title#section]

(cherry picked from commit bbdd975fadc53684048a728aacb459df56c670b5)