diff --git a/src/applications/feed/story/PhabricatorFeedStory.php b/src/applications/feed/story/PhabricatorFeedStory.php index 8a15301216..c3984573c7 100644 --- a/src/applications/feed/story/PhabricatorFeedStory.php +++ b/src/applications/feed/story/PhabricatorFeedStory.php @@ -462,7 +462,7 @@ abstract class PhabricatorFeedStory } public function newMarkupEngine($field) { - return PhabricatorMarkupEngine::getEngine(); + return PhabricatorMarkupEngine::getEngine('feed'); } public function getMarkupText($field) { diff --git a/src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php b/src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php index 0fb2243d89..e054c2acd9 100644 --- a/src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php +++ b/src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php @@ -252,6 +252,12 @@ final class PhabricatorEmbedFileRemarkupRule $autoplay = null; } + // Rendering contexts like feed can disable autoplay. + $engine = $this->getEngine(); + if ($engine->getConfig('autoplay.disable')) { + $autoplay = null; + } + return $this->newTag( $tag, array( diff --git a/src/infrastructure/markup/PhabricatorMarkupEngine.php b/src/infrastructure/markup/PhabricatorMarkupEngine.php index 6f13525c76..3ce5578f82 100644 --- a/src/infrastructure/markup/PhabricatorMarkupEngine.php +++ b/src/infrastructure/markup/PhabricatorMarkupEngine.php @@ -414,6 +414,10 @@ final class PhabricatorMarkupEngine extends Phobject { case 'default': $engine = self::newMarkupEngine(array()); break; + case 'feed': + $engine = self::newMarkupEngine(array()); + $engine->setConfig('autoplay.disable', true); + break; case 'nolinebreaks': $engine = self::newMarkupEngine(array()); $engine->setConfig('preserve-linebreaks', false);