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)
Fri, Dec 27, 3:05 PM
Unknown Object (File)
Mon, Dec 16, 10:15 PM
Unknown Object (File)
Sat, Dec 14, 5:35 PM
Unknown Object (File)
Sun, Dec 8, 4:43 PM
Unknown Object (File)
Fri, Dec 6, 12:01 AM
Unknown Object (File)
Dec 3 2024, 11:22 PM
Unknown Object (File)
Nov 26 2024, 10:26 AM
Unknown Object (File)
Nov 20 2024, 1:19 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