@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

make remarkup savvier about fragments in phriction links

Summary:
use PhutilURI class to get the slug and the fragment, normalize the slug, and then glue it back together with another PhutilURI

fixes https://github.com/facebook/phabricator/issues/228

Test Plan: had a few links like [[ example/doc#title | wiki fun ]] and verified links generated were correct

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3894

+9 -5
+9 -5
src/infrastructure/markup/rule/PhabricatorRemarkupRulePhriction.php
··· 15 15 16 16 public function markupDocumentLink($matches) { 17 17 18 - $slug = trim($matches[1]); 19 - $name = trim(idx($matches, 2, $slug)); 18 + $link = trim($matches[1]); 19 + $name = trim(idx($matches, 2, $link)); 20 20 $name = explode('/', trim($name, '/')); 21 21 $name = end($name); 22 22 23 - $slug = PhabricatorSlug::normalize($slug); 24 - $uri = PhrictionDocument::getSlugURI($slug); 23 + $uri = new PhutilURI($link); 24 + $slug = $uri->getPath(); 25 + $fragment = $uri->getFragment(); 26 + $slug = PhabricatorSlug::normalize($slug); 27 + $slug = PhrictionDocument::getSlugURI($slug); 28 + $href = (string) id(new PhutilURI($slug))->setFragment($fragment); 25 29 26 30 return $this->getEngine()->storeText( 27 31 phutil_render_tag( 28 32 'a', 29 33 array( 30 - 'href' => $uri, 34 + 'href' => $href, 31 35 'class' => 'phriction-link', 32 36 ), 33 37 phutil_escape_html($name)));