Page MenuHomePhabricator

Support relative links in Phriction

Authored by hach-que on Apr 16 2016, 2:23 AM.



Resolves T7691. This turned out more complex than I really wanted, mainly because I needed to feed the slug information through to both the document renderer and the preview window that appears in the edit controller.

After this change, you can now create relative links in Phriction by doing [[ ./../some/relative/path ]]. Relative paths aren't handled anywhere else (they'll still render, but the dots are turned into a literal 'dot' as per existing behaviour).

Test Plan

Created some Phriction documents with relative links, saw them all link correctly.

Diff Detail

rP Phabricator
Lint Not Applicable
Tests Not Applicable

Event Timeline

hach-que retitled this revision from to Support relative links in Phriction.
hach-que updated this object.
hach-que edited the test plan for this revision. (Show Details)
hach-que added a reviewer: epriestley.

@epriestley Passing the slug through to Remarkup like this feels like a bit of a kludge; especially because the preview window requires making a new preview controller. I'm not sure how to proceed with this?

epriestley edited edge metadata.

By the end of this we should update the docs, too.


This could go elsewhere, but ../x/y is probably fine to trigger this too.


Consider structuring this more explicitly to improve clarity.

This revision is now accepted and ready to land.Apr 16 2016, 2:52 AM

Oh, and I think it's fine to have the new controller / context thing. It's a little kludgey but there aren't many (any?) other cases of things like this right now so it's probably not worth trying to build something fancy to de-kludge it.


I think the linter ate the newlines here. I'll throw in a comment to stop it condensing this block (but also explain the treatment of .).


I'll leave this as-is for now and we can update it later if people expect it to work (because easier to add a Remarkup rule later than remove them).

hach-que edited edge metadata.

Fix linter weirdness and add comment

This revision was automatically updated to reflect the committed changes.