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

Tune project hashtags a little more

Summary: Fixes T7738. Improves handling of question marks and quotation marks.

Test Plan: Unit tests.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7738

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

+45 -1
+15 -1
src/applications/project/remarkup/ProjectRemarkupRule.php
··· 30 30 // In other contexts, the PhabricatorProjectProjectPHIDType pattern is 31 31 // controlling and these names should parse correctly. 32 32 33 - return '[^\s.\d!,:;{}#\(\)]+(?:[^\s!,:;{}#\(\)]*[^\s.!,:;{}#\(\)]+)*'; 33 + // These characters may never appear anywhere in a hashtag. 34 + $never = '\s?!,:;{}#\\(\\)"\''; 35 + 36 + // These characters may not appear at the beginning. 37 + $never_first = '.\d'; 38 + 39 + // These characters may not appear at the end. 40 + $never_last = '.'; 41 + 42 + return 43 + '[^'.$never_first.$never.']+'. 44 + '(?:'. 45 + '[^'.$never.']*'. 46 + '[^'.$never_last.$never.']+'. 47 + ')*'; 34 48 } 35 49 36 50 protected function loadObjects(array $ids) {
+30
src/applications/project/remarkup/__tests__/ProjectRemarkupRuleTestCase.php
··· 81 81 ), 82 82 ), 83 83 84 + 'Is this #urgent?' => array( 85 + 'embed' => array(), 86 + 'ref' => array( 87 + array( 88 + 'offset' => 9, 89 + 'id' => 'urgent', 90 + ), 91 + ), 92 + ), 93 + 94 + 'This is "#urgent".' => array( 95 + 'embed' => array(), 96 + 'ref' => array( 97 + array( 98 + 'offset' => 10, 99 + 'id' => 'urgent', 100 + ), 101 + ), 102 + ), 103 + 104 + 'This is \'#urgent\'.' => array( 105 + 'embed' => array(), 106 + 'ref' => array( 107 + array( 108 + 'offset' => 10, 109 + 'id' => 'urgent', 110 + ), 111 + ), 112 + ), 113 + 84 114 ); 85 115 86 116 foreach ($cases as $input => $expect) {