Improve behavior of named anchor links

Summary: Fixes T3220. We currently don't handle `[[ #anchor ]]` very well in remarkup.

Test Plan:
Unit tests.

{F43706}

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T3220

Differential Revision: https://secure.phabricator.com/D5974