mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-11 15:21:03 +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');
|
$slugs = ipull($metadata, 'link');
|
||||||
|
foreach ($slugs as $key => $slug) {
|
||||||
|
$slugs[$key] = PhabricatorSlug::normalize($slug);
|
||||||
|
}
|
||||||
|
|
||||||
// We have to make two queries here to distinguish between
|
// We have to make two queries here to distinguish between
|
||||||
// documents the user can't see, and documents that don't
|
// 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) {
|
if (idx($existant_documents, $slug) === null) {
|
||||||
// The target document doesn't exist.
|
// The target document doesn't exist.
|
||||||
if ($name === null) {
|
if ($name === null) {
|
||||||
$name = explode('/', trim($slug, '/'));
|
$name = explode('/', trim($link, '/'));
|
||||||
$name = end($name);
|
$name = end($name);
|
||||||
}
|
}
|
||||||
$class = 'phriction-link-missing';
|
$class = 'phriction-link-missing';
|
||||||
} else if (idx($visible_documents, $slug) === null) {
|
} else if (idx($visible_documents, $slug) === null) {
|
||||||
// The document exists, but the user can't see it.
|
// The document exists, but the user can't see it.
|
||||||
if ($name === null) {
|
if ($name === null) {
|
||||||
$name = explode('/', trim($slug, '/'));
|
$name = explode('/', trim($link, '/'));
|
||||||
$name = end($name);
|
$name = end($name);
|
||||||
}
|
}
|
||||||
$class = 'phriction-link-lock';
|
$class = 'phriction-link-lock';
|
||||||
|
|
Loading…
Reference in a new issue