mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 08:42:41 +01:00
Phabricator changes for TOC markup
Summary: See T2333 / D4565. Fixes the Phriction rule. Test Plan: See D4565. Reviewers: btrahan, vrana Reviewed By: btrahan CC: aran Maniphest Tasks: T2333 Differential Revision: https://secure.phabricator.com/D4566
This commit is contained in:
parent
d5b006b2cc
commit
08e61c6ff1
2 changed files with 14 additions and 9 deletions
|
@ -41,7 +41,7 @@ final class PhabricatorMarkupEngine {
|
||||||
|
|
||||||
private $objects = array();
|
private $objects = array();
|
||||||
private $viewer;
|
private $viewer;
|
||||||
private $version = 1;
|
private $version = 2;
|
||||||
|
|
||||||
|
|
||||||
/* -( Markup Pipeline )---------------------------------------------------- */
|
/* -( Markup Pipeline )---------------------------------------------------- */
|
||||||
|
|
|
@ -27,14 +27,19 @@ final class PhabricatorRemarkupRulePhriction
|
||||||
$slug = PhrictionDocument::getSlugURI($slug);
|
$slug = PhrictionDocument::getSlugURI($slug);
|
||||||
$href = (string) id(new PhutilURI($slug))->setFragment($fragment);
|
$href = (string) id(new PhutilURI($slug))->setFragment($fragment);
|
||||||
|
|
||||||
return $this->getEngine()->storeText(
|
if ($this->getEngine()->getState('toc')) {
|
||||||
phutil_render_tag(
|
$text = phutil_escape_html($name);
|
||||||
|
} else {
|
||||||
|
$text = phutil_render_tag(
|
||||||
'a',
|
'a',
|
||||||
array(
|
array(
|
||||||
'href' => $href,
|
'href' => $href,
|
||||||
'class' => 'phriction-link',
|
'class' => 'phriction-link',
|
||||||
),
|
),
|
||||||
phutil_escape_html($name)));
|
phutil_escape_html($name));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->getEngine()->storeText($text);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue