diff --git a/src/applications/macro/controller/PhabricatorMacroMemeDialogController.php b/src/applications/macro/controller/PhabricatorMacroMemeDialogController.php index df07660b3d..9bb82f9926 100644 --- a/src/applications/macro/controller/PhabricatorMacroMemeDialogController.php +++ b/src/applications/macro/controller/PhabricatorMacroMemeDialogController.php @@ -28,8 +28,16 @@ final class PhabricatorMacroMemeDialogController } if (!$errors) { + $options = new PhutilSimpleOptions(); + $data = array( + 'src' => $name, + 'above' => $above, + 'below' => $below, + ); + $string = $options->unparse($data, $escape = '}'); + $result = array( - 'text' => "{meme, src={$name}, above={$above}, below={$below}}", + 'text' => "{meme, {$string}}", ); return id(new AphrontAjaxResponse())->setContent($result); } diff --git a/src/infrastructure/markup/rule/PhabricatorRemarkupRuleMeme.php b/src/infrastructure/markup/rule/PhabricatorRemarkupRuleMeme.php index 1254d044ad..665fbf7a95 100644 --- a/src/infrastructure/markup/rule/PhabricatorRemarkupRuleMeme.php +++ b/src/infrastructure/markup/rule/PhabricatorRemarkupRuleMeme.php @@ -10,7 +10,7 @@ final class PhabricatorRemarkupRuleMeme public function apply($text) { return preg_replace_callback( - '@{meme,([^}]+)}$@m', + '@{meme,((?:[^}\\\\]+|\\\\.)+)}$@m', array($this, 'markupMeme'), $text); }