From b0edca729482fb5eaeb094242cfc57fa5bb106f3 Mon Sep 17 00:00:00 2001 From: vrana Date: Fri, 11 Jan 2013 15:46:41 -0800 Subject: [PATCH] Display #1 instead of #comment-1 in comment anchors Summary: I changed this a long time ago probably without knowing that this format is usable in Remarkup. Test Plan: Viewed revision and task. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4413 --- .../differential/view/DifferentialRevisionCommentView.php | 7 ++++--- .../maniphest/view/ManiphestTransactionDetailView.php | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/applications/differential/view/DifferentialRevisionCommentView.php b/src/applications/differential/view/DifferentialRevisionCommentView.php index 0c78345757..83b7d494ed 100644 --- a/src/applications/differential/view/DifferentialRevisionCommentView.php +++ b/src/applications/differential/view/DifferentialRevisionCommentView.php @@ -180,10 +180,11 @@ final class DifferentialRevisionCommentView extends AphrontView { } else { $xaction_view->setEpoch($comment->getDateCreated()); if ($this->anchorName) { - $anchor_name = $this->anchorName; - $anchor_text = 'D'.$comment->getRevisionID().'#'.$anchor_name; + $anchor_text = + 'D'.$comment->getRevisionID(). + '#'.preg_replace('/^comment-/', '', $this->anchorName); - $xaction_view->setAnchor($anchor_name, $anchor_text); + $xaction_view->setAnchor($this->anchorName, $anchor_text); } } diff --git a/src/applications/maniphest/view/ManiphestTransactionDetailView.php b/src/applications/maniphest/view/ManiphestTransactionDetailView.php index 7ed66c4875..320b577c04 100644 --- a/src/applications/maniphest/view/ManiphestTransactionDetailView.php +++ b/src/applications/maniphest/view/ManiphestTransactionDetailView.php @@ -206,7 +206,9 @@ final class ManiphestTransactionDetailView extends ManiphestView { $xaction_view->setEpoch($any_transaction->getDateCreated()); if ($this->commentNumber) { $anchor_name = 'comment-'.$this->commentNumber; - $anchor_text = 'T'.$any_transaction->getTaskID().'#'.$anchor_name; + $anchor_text = + 'T'.$any_transaction->getTaskID(). + '#'.$this->commentNumber; $xaction_view->setAnchor($anchor_name, $anchor_text); }