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

Adjust remarkup rule precedence for embeds

Summary: The monospaced rule should still have higher precedence than these
rules, so use flat text tests to cover some rule interactions.

Auditors: btrahan

+24 -4
+5 -1
src/applications/diviner/markup/DivinerRemarkupRuleSymbol.php
··· 5 5 const KEY_RULE_ATOM_REF = 'rule.diviner.atomref'; 6 6 7 7 public function getPriority() { 8 - return 40.0; 8 + return 200.0; 9 9 } 10 10 11 11 public function apply($text) { ··· 34 34 } 35 35 36 36 public function markupSymbol($matches) { 37 + if ($this->isTextFlat($matches[0])) { 38 + return $matches[0]; 39 + } 40 + 37 41 $type = (string)idx($matches, 'type'); 38 42 $name = (string)$matches['name']; 39 43 $title = (string)idx($matches, 'title');
+5 -1
src/applications/macro/remarkup/PhabricatorRemarkupRuleIcon.php
··· 4 4 extends PhutilRemarkupRule { 5 5 6 6 public function getPriority() { 7 - return 50.0; 7 + return 200.0; 8 8 } 9 9 10 10 public function apply($text) { ··· 15 15 } 16 16 17 17 public function markupIcon($matches) { 18 + if (!$this->isFlatText($matches[0])) { 19 + return $matches[0]; 20 + } 21 + 18 22 $extra = idx($matches, 1); 19 23 20 24 // We allow various forms, like these:
+5 -1
src/applications/macro/remarkup/PhabricatorRemarkupRuleMeme.php
··· 9 9 private $images; 10 10 11 11 public function getPriority() { 12 - return 50.0; 12 + return 200.0; 13 13 } 14 14 15 15 public function apply($text) { ··· 20 20 } 21 21 22 22 public function markupMeme($matches) { 23 + if (!$this->isFlatText($matches[0])) { 24 + return $matches[0]; 25 + } 26 + 23 27 $options = array( 24 28 'src' => null, 25 29 'above' => null,
+9 -1
src/infrastructure/markup/rule/PhabricatorRemarkupRuleObject.php
··· 13 13 abstract protected function loadObjects(array $ids); 14 14 15 15 public function getPriority() { 16 - return 50.0; 16 + return 200.0; 17 17 } 18 18 19 19 protected function getObjectNamePrefixBeginsWithWordCharacter() { ··· 133 133 } 134 134 135 135 public function markupObjectEmbed($matches) { 136 + if (!$this->isFlatText($matches[0])) { 137 + return $matches[0]; 138 + } 139 + 136 140 return $this->markupObject(array( 137 141 'type' => 'embed', 138 142 'id' => $matches[1], ··· 142 146 } 143 147 144 148 public function markupObjectReference($matches) { 149 + if (!$this->isFlatText($matches[0])) { 150 + return $matches[0]; 151 + } 152 + 145 153 return $this->markupObject(array( 146 154 'type' => 'ref', 147 155 'id' => $matches[1],