File tree Expand file tree Collapse file tree 4 files changed +23
-17
lines changed
infrastructure/markup/rule Expand file tree Collapse file tree 4 files changed +23
-17
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,17 @@ public function getOptions() {
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 (
Original file line number Diff line number Diff line change @@ -14,16 +14,4 @@ protected function loadObjects(array $ids) {
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
}
Original file line number Diff line number Diff line change @@ -297,8 +297,8 @@ Markdown-style links are also supported:
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
@@ -310,6 +310,9 @@ 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
312
313
+ See the Phabricator configuraton setting `remarkup.ignored-object-names` to
314
+ modify this behavior.
315
+
313
316
= Embedding Objects
314
317
315
318
You can also generate full-name references to some objects by using braces:
@@ -411,8 +414,7 @@ If you set a configuration flag, you can embed media directly in text:
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
Original file line number Diff line number Diff line change @@ -158,6 +158,12 @@ private function markupObject(array $params) {
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
You can’t perform that action at this time.
0 commit comments