Page MenuHomePhabricator

Support relative links in Phriction
ClosedPublic

Authored by hach-que on Apr 16 2016, 2:23 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 18, 8:20 AM
Unknown Object (File)
Sat, Mar 16, 6:08 PM
Unknown Object (File)
Sat, Mar 16, 5:34 PM
Unknown Object (File)
Sat, Mar 16, 4:10 PM
Unknown Object (File)
Sat, Mar 16, 3:14 PM
Unknown Object (File)
Sat, Mar 16, 2:37 PM
Unknown Object (File)
Wed, Mar 13, 6:40 PM
Unknown Object (File)
Tue, Mar 5, 5:18 PM
Subscribers
Tokens
"Yellow Medal" token, awarded by eadler."Doubloon" token, awarded by epriestley.

Details

Summary

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

Repository
rP Phabricator
Branch
phriction-relative (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 11783
Build 14771: Run Core Tests
Build 14770: arc lint + arc unit

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.

src/applications/phriction/markup/PhrictionRemarkupRule.php
20

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

36

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.

src/applications/phriction/markup/PhrictionRemarkupRule.php
36

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 .).

src/applications/phriction/markup/PhrictionRemarkupRule.php
20

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.