Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15419974
D11954.id28780.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11954.id28780.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D11954: Don't match parentheses as a hashtag character
Attached
Detach File
Event Timeline
Log In to Comment