Page MenuHomePhabricator

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

Authored by epriestley on May 9 2019, 7:59 PM.

Details

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":

Diff Detail

Repository
rPHU libphutil
Branch
sref3
Lint
Lint OK
Unit
Unit Tests OK
Build Status
Buildable 22777
Build 31241: Run Core Tests
Build 31240: arc lint + arc unit