@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.

Remarkup - add a regex to blacklist what objects get link

Summary: Fixes T5453.

Test Plan: made a remarkup comment that "Q1 is dumb and Q10 is awesome" and only Q10 was linked. changed the new setting to have the value " " and the Q1 also started linking.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5453

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

+23 -17
+11 -1
src/applications/config/option/PhabricatorCoreConfigOptions.php
··· 120 120 'Maniphest. If you\'d prefer more traditional UI strings like '. 121 121 '"Add Comment", you can set this flag to disable most of the '. 122 122 'extra flavor.')), 123 - $this->newOption('environment.append-paths', 'list<string>', $paths) 123 + $this->newOption('remarkup.ignored-object-names', 'string', '/^(Q|V)\d$/') 124 + ->setSummary( 125 + pht('Text values that match this regex and are also object names '. 126 + 'will not be linked.')) 127 + ->setDescription( 128 + pht( 129 + 'By default, Phabricator links object names in Remarkup fields '. 130 + 'to the corresponding object. This regex can be used to modify '. 131 + 'this behavior; object names that match this regex will not be '. 132 + 'linked.')), 133 + $this->newOption('environment.append-paths', 'list<string>', $paths) 124 134 ->setSummary( 125 135 pht('These paths get appended to your \$PATH envrionment variable.')) 126 136 ->setDescription(
-12
src/applications/ponder/remarkup/PonderRemarkupRule.php
··· 14 14 ->execute(); 15 15 } 16 16 17 - protected function shouldMarkupObject(array $params) { 18 - // NOTE: Q1, Q2, Q3 and Q4 are often used to refer to quarters of the year; 19 - // mark them up only in the {Q1} format. 20 - if ($params['type'] == 'ref') { 21 - if ($params['id'] <= 4) { 22 - return false; 23 - } 24 - } 25 - 26 - return true; 27 - } 28 - 29 17 }
+6 -4
src/docs/user/userguide/remarkup.diviner
··· 297 297 298 298 = Linking to Objects = 299 299 300 - You can link to Differential revisions, Diffusion commits and Maniphest tasks 301 - by mentioning the name of an object: 300 + You can link to Phabricator objects, such as Differential revisions, Diffusion 301 + commits and Maniphest tasks, by mentioning the name of an object: 302 302 303 303 D123 # Link to Differential revision D123 304 304 rX123 # Link to SVN commit 123 from the "X" repository ··· 309 309 You can also link directly to a comment in Maniphest and Differential: 310 310 311 311 T123#4 # Link to comment #4 of T123 312 + 313 + See the Phabricator configuraton setting `remarkup.ignored-object-names` to 314 + modify this behavior. 312 315 313 316 = Embedding Objects 314 317 ··· 411 414 and have them render inline. 412 415 413 416 This option is disabled by default because it has security and/or 414 - silliness implications. Read the description in `default.conf.php` before 415 - enabling it. 417 + silliness implications. Carefully read the description before enabling it. 416 418 417 419 = Image Macros = 418 420
+6
src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php
··· 158 158 return $params['original']; 159 159 } 160 160 161 + $regex = trim( 162 + PhabricatorEnv::getEnvConfig('remarkup.ignored-object-names')); 163 + if ($regex && preg_match($regex, $params['original'])) { 164 + return $params['original']; 165 + } 166 + 161 167 $engine = $this->getEngine(); 162 168 $token = $engine->storeText('x'); 163 169