Page MenuHomePhabricator

Specialize rendering of self-URIs in the form "/X123"

Authored by epriestley on May 9 2019, 8:34 PM.



Depends on D20510. Ref T5378. When remarkup includes a hyperlink to the current install in the form "/X123" (which is common), load the corresponding object and specialize the rendering.

This doesn't cover everything (notably, no handling for Diffusion paths yet), but does cover a lot of the most common cases.

The "uri" form preserves the URI as written, but adds an icon, tag, and hovercard.

The "{uri}" form is more similar to {T123} and shows the object name.

Test Plan

Diff Detail

rP Phabricator
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Slightly more complete test case:

Harbormaster returned this revision to the author for changes because remote builds failed.May 9 2019, 8:35 PM
Harbormaster failed remote builds in B22778: Diff 48905!

(Test failures are because of D20511 not being landed yet.)

joshuaspence added a subscriber: joshuaspence.
joshuaspence added inline comments.

A minor point, but this will match /robots.txt... should the regex be tightened so as to only allow monograms?


I guess it doesn't really matter since you are looking up the objects anyway.

This revision is now accepted and ready to land.May 14 2019, 12:36 AM

Yeah, we'll match various patterns, and /D99999999999999, but I expect these to be pretty rare and the behavior will still be correct, we'll just do a little extra work (discarding thing as a possible object name, or querying for D99999999999 and failing to load it).

This revision was landed with ongoing or failed builds.May 16 2019, 7:16 PM
This revision was automatically updated to reflect the committed changes.