diff --git a/src/applications/diviner/markup/DivinerRemarkupRuleSymbol.php b/src/applications/diviner/markup/DivinerRemarkupRuleSymbol.php index b851555f07..48ff6655b8 100644 --- a/src/applications/diviner/markup/DivinerRemarkupRuleSymbol.php +++ b/src/applications/diviner/markup/DivinerRemarkupRuleSymbol.php @@ -5,7 +5,7 @@ final class DivinerRemarkupRuleSymbol extends PhutilRemarkupRule { const KEY_RULE_ATOM_REF = 'rule.diviner.atomref'; public function getPriority() { - return 40.0; + return 200.0; } public function apply($text) { @@ -34,6 +34,10 @@ final class DivinerRemarkupRuleSymbol extends PhutilRemarkupRule { } public function markupSymbol($matches) { + if ($this->isTextFlat($matches[0])) { + return $matches[0]; + } + $type = (string)idx($matches, 'type'); $name = (string)$matches['name']; $title = (string)idx($matches, 'title'); diff --git a/src/applications/macro/remarkup/PhabricatorRemarkupRuleIcon.php b/src/applications/macro/remarkup/PhabricatorRemarkupRuleIcon.php index 0e59f94e64..a301578030 100644 --- a/src/applications/macro/remarkup/PhabricatorRemarkupRuleIcon.php +++ b/src/applications/macro/remarkup/PhabricatorRemarkupRuleIcon.php @@ -4,7 +4,7 @@ final class PhabricatorRemarkupRuleIcon extends PhutilRemarkupRule { public function getPriority() { - return 50.0; + return 200.0; } public function apply($text) { @@ -15,6 +15,10 @@ final class PhabricatorRemarkupRuleIcon } public function markupIcon($matches) { + if (!$this->isFlatText($matches[0])) { + return $matches[0]; + } + $extra = idx($matches, 1); // We allow various forms, like these: diff --git a/src/applications/macro/remarkup/PhabricatorRemarkupRuleMeme.php b/src/applications/macro/remarkup/PhabricatorRemarkupRuleMeme.php index 242f2a8db1..7deed4a6c8 100644 --- a/src/applications/macro/remarkup/PhabricatorRemarkupRuleMeme.php +++ b/src/applications/macro/remarkup/PhabricatorRemarkupRuleMeme.php @@ -9,7 +9,7 @@ final class PhabricatorRemarkupRuleMeme private $images; public function getPriority() { - return 50.0; + return 200.0; } public function apply($text) { @@ -20,6 +20,10 @@ final class PhabricatorRemarkupRuleMeme } public function markupMeme($matches) { + if (!$this->isFlatText($matches[0])) { + return $matches[0]; + } + $options = array( 'src' => null, 'above' => null, diff --git a/src/infrastructure/markup/rule/PhabricatorRemarkupRuleObject.php b/src/infrastructure/markup/rule/PhabricatorRemarkupRuleObject.php index ee5fd3a2b4..c22f4285c4 100644 --- a/src/infrastructure/markup/rule/PhabricatorRemarkupRuleObject.php +++ b/src/infrastructure/markup/rule/PhabricatorRemarkupRuleObject.php @@ -13,7 +13,7 @@ abstract class PhabricatorRemarkupRuleObject abstract protected function loadObjects(array $ids); public function getPriority() { - return 50.0; + return 200.0; } protected function getObjectNamePrefixBeginsWithWordCharacter() { @@ -133,6 +133,10 @@ abstract class PhabricatorRemarkupRuleObject } public function markupObjectEmbed($matches) { + if (!$this->isFlatText($matches[0])) { + return $matches[0]; + } + return $this->markupObject(array( 'type' => 'embed', 'id' => $matches[1], @@ -142,6 +146,10 @@ abstract class PhabricatorRemarkupRuleObject } public function markupObjectReference($matches) { + if (!$this->isFlatText($matches[0])) { + return $matches[0]; + } + return $this->markupObject(array( 'type' => 'ref', 'id' => $matches[1],