HomePhabricator

Provide an extension point for handling hyperlinks in remarkup in a special way

Description

Provide an extension point for handling hyperlinks in remarkup in a special way

Summary:
Ref T5378. Although some dicussion there talks about separating "self-uri" matching and non-self-URI matching into two phases, the URI matching code has enough weird magic that it felt cleaner to put them in one phase with an extension point.

Match URIs into structured data, then allow extensions to specialize the rendering behavior. This matches three flavors of URI:

  • "uri" can be specialized.
  • "<uri>" is a "literal" URI and can NOT be specialized. This already exists/works.
  • "{uri}" is an "embedded" URI and can ONLY be specialized (the default rendering is just the plain text).

On its own, this change doesn't affect any rendering behavior.

Test Plan:
Added a small extension to Phabricator to recognize self-URIs, then built this very basic prototype of "handle self-URIs in a special way":

Screen Shot 2019-05-09 at 12.53.35 PM.png (555×418 px, 44 KB)

Reviewers: amckinley, joshuaspence

Reviewed By: joshuaspence

Maniphest Tasks: T5378

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