Skip to content

Commit 08e61c6

Browse files
author
epriestley
committed
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
1 parent d5b006b commit 08e61c6

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

src/infrastructure/markup/PhabricatorMarkupEngine.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ final class PhabricatorMarkupEngine {
4141

4242
private $objects = array();
4343
private $viewer;
44-
private $version = 1;
44+
private $version = 2;
4545

4646

4747
/* -( Markup Pipeline )---------------------------------------------------- */

src/infrastructure/markup/rule/PhabricatorRemarkupRulePhriction.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,19 @@ public function markupDocumentLink($matches) {
2727
$slug = PhrictionDocument::getSlugURI($slug);
2828
$href = (string) id(new PhutilURI($slug))->setFragment($fragment);
2929

30-
return $this->getEngine()->storeText(
31-
phutil_render_tag(
32-
'a',
33-
array(
34-
'href' => $href,
35-
'class' => 'phriction-link',
36-
),
37-
phutil_escape_html($name)));
30+
if ($this->getEngine()->getState('toc')) {
31+
$text = phutil_escape_html($name);
32+
} else {
33+
$text = phutil_render_tag(
34+
'a',
35+
array(
36+
'href' => $href,
37+
'class' => 'phriction-link',
38+
),
39+
phutil_escape_html($name));
40+
}
41+
42+
return $this->getEngine()->storeText($text);
3843
}
3944

4045
}

0 commit comments

Comments
 (0)