Page MenuHomePhabricator

D11954.id28780.diff
No OneTemporary

D11954.id28780.diff

diff --git a/src/applications/project/remarkup/ProjectRemarkupRule.php b/src/applications/project/remarkup/ProjectRemarkupRule.php
--- a/src/applications/project/remarkup/ProjectRemarkupRule.php
+++ b/src/applications/project/remarkup/ProjectRemarkupRule.php
@@ -30,7 +30,7 @@
// In other contexts, the PhabricatorProjectProjectPHIDType pattern is
// controlling and these names should parse correctly.
- return '[^\s.\d!,:;{}#]+(?:[^\s!,:;{}#][^\s.!,:;{}#]+)*';
+ return '[^\s.\d!,:;{}#\(\)]+(?:[^\s!,:;{}#\(\)][^\s.!,:;{}#\(\)]+)*';
}
protected function loadObjects(array $ids) {
diff --git a/src/applications/project/remarkup/__tests__/ProjectRemarkupRuleTestCase.php b/src/applications/project/remarkup/__tests__/ProjectRemarkupRuleTestCase.php
--- a/src/applications/project/remarkup/__tests__/ProjectRemarkupRuleTestCase.php
+++ b/src/applications/project/remarkup/__tests__/ProjectRemarkupRuleTestCase.php
@@ -45,6 +45,31 @@
),
),
),
+
+ // Don't match a terminal parenthesis. This fixes these constructs in
+ // natural language.
+ 'There is some documentation (see #guides).' => array(
+ 'embed' => array(),
+ 'ref' => array(
+ array(
+ 'offset' => 34,
+ 'id' => 'guides',
+ ),
+ ),
+ ),
+
+ // Don't match internal parentheses either. This makes the terminal
+ // parenthesis behavior less arbitrary (otherwise, we match open
+ // parentheses but not closing parentheses, which is surprising).
+ '#a(b)c' => array(
+ 'embed' => array(),
+ 'ref' => array(
+ array(
+ 'offset' => 1,
+ 'id' => 'a',
+ ),
+ ),
+ ),
);
foreach ($cases as $input => $expect) {

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 22, 10:17 AM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7713117
Default Alt Text
D11954.id28780.diff (1 KB)

Event Timeline