Page MenuHomePhabricator

D15858.diff
No OneTemporary

D15858.diff

diff --git a/src/markup/engine/remarkup/blockrule/PhutilRemarkupDefaultBlockRule.php b/src/markup/engine/remarkup/blockrule/PhutilRemarkupDefaultBlockRule.php
--- a/src/markup/engine/remarkup/blockrule/PhutilRemarkupDefaultBlockRule.php
+++ b/src/markup/engine/remarkup/blockrule/PhutilRemarkupDefaultBlockRule.php
@@ -11,17 +11,19 @@
}
public function markupText($text, $children) {
+ $engine = $this->getEngine();
+
$text = trim($text);
$text = $this->applyRules($text);
- if ($this->getEngine()->isTextMode()) {
+ if ($engine->isTextMode()) {
if (!$this->getEngine()->getConfig('preserve-linebreaks')) {
$text = preg_replace('/ *\n */', ' ', $text);
}
return $text;
}
- if ($this->getEngine()->getConfig('preserve-linebreaks')) {
+ if ($engine->getConfig('preserve-linebreaks')) {
$text = phutil_escape_html_newlines($text);
}
@@ -29,7 +31,14 @@
return null;
}
- return phutil_tag('p', array(), $text);
+ $default_attributes = $engine->getConfig('default.p.attributes');
+ if ($default_attributes) {
+ $attributes = $default_attributes;
+ } else {
+ $attributes = array();
+ }
+
+ return phutil_tag('p', $attributes, $text);
}
}

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 27, 4:10 PM (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7716462
Default Alt Text
D15858.diff (1 KB)

Event Timeline