Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14410730
D10270.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D10270.diff
View Options
diff --git a/src/applications/config/option/PhabricatorCoreConfigOptions.php b/src/applications/config/option/PhabricatorCoreConfigOptions.php
--- a/src/applications/config/option/PhabricatorCoreConfigOptions.php
+++ b/src/applications/config/option/PhabricatorCoreConfigOptions.php
@@ -120,7 +120,17 @@
'Maniphest. If you\'d prefer more traditional UI strings like '.
'"Add Comment", you can set this flag to disable most of the '.
'extra flavor.')),
- $this->newOption('environment.append-paths', 'list<string>', $paths)
+ $this->newOption('remarkup.ignored-object-names', 'string', '/^(Q|V)\d$/')
+ ->setSummary(
+ pht('Text values that match this regex and are also object names '.
+ 'will not be linked.'))
+ ->setDescription(
+ pht(
+ 'By default, Phabricator links object names in Remarkup fields '.
+ 'to the corresponding object. This regex can be used to modify '.
+ 'this behavior; object names that match this regex will not be '.
+ 'linked.')),
+ $this->newOption('environment.append-paths', 'list<string>', $paths)
->setSummary(
pht('These paths get appended to your \$PATH envrionment variable.'))
->setDescription(
diff --git a/src/applications/ponder/remarkup/PonderRemarkupRule.php b/src/applications/ponder/remarkup/PonderRemarkupRule.php
--- a/src/applications/ponder/remarkup/PonderRemarkupRule.php
+++ b/src/applications/ponder/remarkup/PonderRemarkupRule.php
@@ -14,16 +14,4 @@
->execute();
}
- protected function shouldMarkupObject(array $params) {
- // NOTE: Q1, Q2, Q3 and Q4 are often used to refer to quarters of the year;
- // mark them up only in the {Q1} format.
- if ($params['type'] == 'ref') {
- if ($params['id'] <= 4) {
- return false;
- }
- }
-
- return true;
- }
-
}
diff --git a/src/docs/user/userguide/remarkup.diviner b/src/docs/user/userguide/remarkup.diviner
--- a/src/docs/user/userguide/remarkup.diviner
+++ b/src/docs/user/userguide/remarkup.diviner
@@ -297,8 +297,8 @@
= Linking to Objects =
-You can link to Differential revisions, Diffusion commits and Maniphest tasks
-by mentioning the name of an object:
+You can link to Phabricator objects, such as Differential revisions, Diffusion
+commits and Maniphest tasks, by mentioning the name of an object:
D123 # Link to Differential revision D123
rX123 # Link to SVN commit 123 from the "X" repository
@@ -310,6 +310,9 @@
T123#4 # Link to comment #4 of T123
+See the Phabricator configuraton setting `remarkup.ignored-object-names` to
+modify this behavior.
+
= Embedding Objects
You can also generate full-name references to some objects by using braces:
@@ -411,8 +414,7 @@
and have them render inline.
This option is disabled by default because it has security and/or
-silliness implications. Read the description in `default.conf.php` before
-enabling it.
+silliness implications. Carefully read the description before enabling it.
= Image Macros =
diff --git a/src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php b/src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php
--- a/src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php
+++ b/src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php
@@ -158,6 +158,12 @@
return $params['original'];
}
+ $regex = trim(
+ PhabricatorEnv::getEnvConfig('remarkup.ignored-object-names'));
+ if ($regex && preg_match($regex, $params['original'])) {
+ return $params['original'];
+ }
+
$engine = $this->getEngine();
$token = $engine->storeText('x');
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 25, 8:18 AM (10 h, 23 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6925564
Default Alt Text
D10270.diff (3 KB)
Attached To
Mode
D10270: Remarkup - add a regex to blacklist what objects get link
Attached
Detach File
Event Timeline
Log In to Comment