Page MenuHomePhabricator

D7583.diff

diff --git a/src/aphront/console/plugin/DarkConsoleXHProfPlugin.php b/src/aphront/console/plugin/DarkConsoleXHProfPlugin.php
--- a/src/aphront/console/plugin/DarkConsoleXHProfPlugin.php
+++ b/src/aphront/console/plugin/DarkConsoleXHProfPlugin.php
@@ -87,7 +87,7 @@
'target' => '_blank',
),
pht('Profile Permalink'));
- $result = phutil_tag(
+ $result[] = phutil_tag(
'iframe',
array('src' => "/xhprof/profile/$run/?frame=true"));
} else {
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
@@ -202,13 +202,16 @@
PhabricatorMarkupInterface $object,
$field) {
- $custom = array_merge(
- self::loadCustomInlineRules(),
- self::loadCustomBlockRules());
-
- $custom = mpull($custom, 'getRuleVersion', null);
- ksort($custom);
- $custom = PhabricatorHash::digestForIndex(serialize($custom));
+ static $custom;
+ if ($custom === null) {
+ $custom = array_merge(
+ self::loadCustomInlineRules(),
+ self::loadCustomBlockRules());
+
+ $custom = mpull($custom, 'getRuleVersion', null);
+ ksort($custom);
+ $custom = PhabricatorHash::digestForIndex(serialize($custom));
+ }
return $object->getMarkupFieldKey($field).'@'.$this->version.'@'.$custom;
}
@@ -364,6 +367,10 @@
case 'default':
$engine = self::newMarkupEngine(array());
break;
+ case 'nolinebreaks':
+ $engine = self::newMarkupEngine(array());
+ $engine->setConfig('preserve-linebreaks', false);
+ break;
case 'diviner':
$engine = self::newMarkupEngine(array());
$engine->setConfig('preserve-linebreaks', false);
diff --git a/src/infrastructure/markup/PhabricatorMarkupOneOff.php b/src/infrastructure/markup/PhabricatorMarkupOneOff.php
--- a/src/infrastructure/markup/PhabricatorMarkupOneOff.php
+++ b/src/infrastructure/markup/PhabricatorMarkupOneOff.php
@@ -36,10 +36,11 @@
}
public function newMarkupEngine($field) {
- return PhabricatorMarkupEngine::newMarkupEngine(
- array(
- 'preserve-linebreaks' => $this->preserveLinebreaks,
- ));
+ if ($this->preserveLinebreaks) {
+ return PhabricatorMarkupEngine::getEngine();
+ } else {
+ return PhabricatorMarkupEngine::getEngine('nolinebreaks');
+ }
}
public function getMarkupText($field) {

File Metadata

Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/bv/zu/n5yaxfotrjbyvrcp
Default Alt Text
D7583.diff (2 KB)

Event Timeline