HomePhabricator

Make remarkup link generation rules more flexible and consistent

Description

Make remarkup link generation rules more flexible and consistent

Summary:
Ref T10903. Ref T6299. This provides better support for same-window Remarkup links (for CORGI) and getting the base URI / current page / anchor behavior correct (for Phame custom domains).

The uri.prefix config setting currently has no callsites and is essentially always wrong for either anchor links or same-domain links, unless you happen to be on the home page. Instead:

  • uri.base: Base URI for /x/y/ links, e.g. https://blog.whatever.com/.
  • uri.here: Base URI for #anchor links, e.g. https://blog.whatever.com/post/whatever/.
  • uri.same-window: Render offsite hyperlinks without target="_blank".

The first two will fix Phame custom domain stuff. The third one will let CORGI links stay in the same window.

Test Plan: Unit tests, see also next diff.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T6299, T10903

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