mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 18:22: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);
|
||||||
'a',
|
} else {
|
||||||
array(
|
$text = phutil_render_tag(
|
||||||
'href' => $href,
|
'a',
|
||||||
'class' => 'phriction-link',
|
array(
|
||||||
),
|
'href' => $href,
|
||||||
phutil_escape_html($name)));
|
'class' => 'phriction-link',
|
||||||
|
),
|
||||||
|
phutil_escape_html($name));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->getEngine()->storeText($text);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue