@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix Phriction document linking in mail bodies

Summary:
Fixes T10840. When rendering mail, this rule wasn't falling through in quite the right way.

Also adjust where the rules are for this so the special styles show up in Maniphest, etc.

Test Plan:
Made this comment:

{F1238266}

Which produced this HTML:

{F1238267}

...and sent this mail:

{F1238283}

Reviewers: hach-que, chad

Reviewed By: chad

Maniphest Tasks: T10840

Differential Revision: https://secure.phabricator.com/D15767

+31 -21
+5 -5
resources/celerity/map.php
··· 7 7 */ 8 8 return array( 9 9 'names' => array( 10 - 'core.pkg.css' => 'ce06b6f6', 10 + 'core.pkg.css' => '31417876', 11 11 'core.pkg.js' => '37344f3c', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => '7ba78475', ··· 88 88 'rsrc/css/application/phortune/phortune-credit-card-form.css' => '8391eb02', 89 89 'rsrc/css/application/phortune/phortune.css' => '9149f103', 90 90 'rsrc/css/application/phrequent/phrequent.css' => 'ffc185ad', 91 - 'rsrc/css/application/phriction/phriction-document-css.css' => '55446c91', 91 + 'rsrc/css/application/phriction/phriction-document-css.css' => '4282e4ad', 92 92 'rsrc/css/application/policy/policy-edit.css' => '815c66f7', 93 93 'rsrc/css/application/policy/policy-transaction-detail.css' => '82100a43', 94 94 'rsrc/css/application/policy/policy.css' => '957ea14c', ··· 104 104 'rsrc/css/application/tokens/tokens.css' => '3d0f239e', 105 105 'rsrc/css/application/uiexample/example.css' => '528b19de', 106 106 'rsrc/css/core/core.css' => 'd0801452', 107 - 'rsrc/css/core/remarkup.css' => '2c9ed46f', 107 + 'rsrc/css/core/remarkup.css' => '6aae5360', 108 108 'rsrc/css/core/syntax.css' => '9fd11da8', 109 109 'rsrc/css/core/z-index.css' => '5b6fcf3f', 110 110 'rsrc/css/diviner/diviner-shared.css' => 'aa3656aa', ··· 777 777 'phabricator-object-selector-css' => '85ee8ce6', 778 778 'phabricator-phtize' => 'd254d646', 779 779 'phabricator-prefab' => 'e67df814', 780 - 'phabricator-remarkup-css' => '2c9ed46f', 780 + 'phabricator-remarkup-css' => '6aae5360', 781 781 'phabricator-search-results-css' => '7dea472c', 782 782 'phabricator-shaped-request' => '7cbe244b', 783 783 'phabricator-side-menu-view-css' => '3a3d9f41', ··· 807 807 'phortune-credit-card-form-css' => '8391eb02', 808 808 'phortune-css' => '9149f103', 809 809 'phrequent-css' => 'ffc185ad', 810 - 'phriction-document-css' => '55446c91', 810 + 'phriction-document-css' => '4282e4ad', 811 811 'phui-action-panel-css' => '91c7b835', 812 812 'phui-badge-view-css' => '3baef8db', 813 813 'phui-big-info-view-css' => 'bd903741',
+14 -2
src/applications/phriction/markup/PhrictionRemarkupRule.php
··· 107 107 $name = $spec['explicitName']; 108 108 $class = 'phriction-link'; 109 109 110 + // If the name is something meaningful to humans, we'll render this 111 + // in text as: "Title" <link>. Otherwise, we'll just render: <link>. 112 + $is_interesting_name = (bool)strlen($name); 113 + 110 114 if (idx($existant_documents, $link) === null) { 111 115 // The target document doesn't exist. 112 116 if ($name === null) { ··· 127 131 $name = $visible_documents[$link] 128 132 ->getContent() 129 133 ->getTitle(); 134 + 135 + $is_interesting_name = true; 130 136 } 131 137 } 132 138 ··· 143 149 if ($this->getEngine()->getState('toc')) { 144 150 $text = $name; 145 151 } else if ($text_mode || $mail_mode) { 146 - return PhabricatorEnv::getProductionURI($href); 152 + $href = PhabricatorEnv::getProductionURI($href); 153 + if ($is_interesting_name) { 154 + $text = pht('"%s" <%s>', $name, $href); 155 + } else { 156 + $text = pht('<%s>', $href); 157 + } 147 158 } else { 148 159 if ($class === 'phriction-link-lock') { 149 160 $name = array( ··· 164 175 'class' => $class, 165 176 ), 166 177 $name); 167 - $this->getEngine()->overwriteStoredText($spec['token'], $text); 168 178 } 179 + 180 + $this->getEngine()->overwriteStoredText($spec['token'], $text); 169 181 } 170 182 } 171 183
-14
webroot/rsrc/css/application/phriction/phriction-document-css.css
··· 32 32 .phriction-history-nav-table td.nav-next { 33 33 text-align: right; 34 34 } 35 - 36 - .phui-document-content .phriction-link { 37 - font-weight: bold; 38 - } 39 - 40 - .phui-document-content .phriction-link-missing { 41 - font-weight: bold; 42 - color: {$red}; 43 - } 44 - 45 - .phui-document-content .phriction-link-lock { 46 - font-weight: bold; 47 - color: {$greytext}; 48 - }
+12
webroot/rsrc/css/core/remarkup.css
··· 234 234 background: #ffaaaa; 235 235 } 236 236 237 + .phabricator-remarkup .phriction-link { 238 + font-weight: bold; 239 + } 240 + 241 + .phabricator-remarkup .phriction-link-missing { 242 + color: {$red}; 243 + } 244 + 245 + .phabricator-remarkup .phriction-link-lock { 246 + color: {$greytext}; 247 + } 248 + 237 249 .phabricator-remarkup-mention-nopermission .phui-tag-core { 238 250 background: {$lightgreybackground}; 239 251 color: {$lightgreytext};