Page MenuHomePhabricator

D16920.diff
No OneTemporary

D16920.diff

diff --git a/src/applications/feed/story/PhabricatorFeedStory.php b/src/applications/feed/story/PhabricatorFeedStory.php
--- a/src/applications/feed/story/PhabricatorFeedStory.php
+++ b/src/applications/feed/story/PhabricatorFeedStory.php
@@ -462,7 +462,7 @@
}
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
--- a/src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php
+++ b/src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php
@@ -252,6 +252,12 @@
$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
--- a/src/infrastructure/markup/PhabricatorMarkupEngine.php
+++ b/src/infrastructure/markup/PhabricatorMarkupEngine.php
@@ -414,6 +414,10 @@
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);

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 3:08 AM (20 h, 28 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6907643
Default Alt Text
D16920.diff (1 KB)

Event Timeline