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.
Tags
None
Referenced Files
F18435711: D20511.id.diff
Sun, Aug 31, 10:20 AM
F18434340: D20511.diff
Sun, Aug 31, 9:13 AM
F18419619: D20511.diff
Sat, Aug 30, 2:49 PM
F18343668: D20511.diff
Tue, Aug 26, 8:20 AM
F18100509: D20511.id.diff
Sat, Aug 9, 11:55 AM
F18091615: D20511.id48940.diff
Wed, Aug 6, 11:54 PM
F17853510: D20511.id.diff
Jul 27 2025, 1:59 PM
F17827357: D20511.diff
Jul 26 2025, 8:11 AM
Subscribers
None

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

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

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable