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
Unknown Object (File)
Sat, Mar 16, 11:08 AM
Unknown Object (File)
Fri, Mar 1, 5:22 AM
Unknown Object (File)
Wed, Feb 21, 1:40 PM
Unknown Object (File)
Wed, Feb 21, 9:38 AM
Unknown Object (File)
Feb 8 2024, 11:09 AM
Unknown Object (File)
Feb 3 2024, 10:28 PM
Unknown Object (File)
Feb 3 2024, 10:28 PM
Unknown Object (File)
Feb 3 2024, 10:28 PM
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