mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 22:10:55 +01:00
Fix Phriction link syntax a little more
Summary: This still wasn't quite right -- a link like `[[ Porcupine Facts ]]` with a space would not lookup correctly, and would render as `porcupine_facts`. Test Plan: Verified that `[[ Porcupine Facts ]]` now works correctly. Reviewers: chad Reviewed By: chad Differential Revision: https://secure.phabricator.com/D15780
This commit is contained in:
parent
c986caebb2
commit
fb2b88a4a8
1 changed files with 5 additions and 2 deletions
|
@ -85,6 +85,9 @@ final class PhrictionRemarkupRule extends PhutilRemarkupRule {
|
|||
}
|
||||
|
||||
$slugs = ipull($metadata, 'link');
|
||||
foreach ($slugs as $key => $slug) {
|
||||
$slugs[$key] = PhabricatorSlug::normalize($slug);
|
||||
}
|
||||
|
||||
// We have to make two queries here to distinguish between
|
||||
// documents the user can't see, and documents that don't
|
||||
|
@ -115,14 +118,14 @@ final class PhrictionRemarkupRule extends PhutilRemarkupRule {
|
|||
if (idx($existant_documents, $slug) === null) {
|
||||
// The target document doesn't exist.
|
||||
if ($name === null) {
|
||||
$name = explode('/', trim($slug, '/'));
|
||||
$name = explode('/', trim($link, '/'));
|
||||
$name = end($name);
|
||||
}
|
||||
$class = 'phriction-link-missing';
|
||||
} else if (idx($visible_documents, $slug) === null) {
|
||||
// The document exists, but the user can't see it.
|
||||
if ($name === null) {
|
||||
$name = explode('/', trim($slug, '/'));
|
||||
$name = explode('/', trim($link, '/'));
|
||||
$name = end($name);
|
||||
}
|
||||
$class = 'phriction-link-lock';
|
||||
|
|
Loading…
Reference in a new issue