diff --git a/src/markup/engine/remarkup/blockrule/PhutilRemarkupDefaultBlockRule.php b/src/markup/engine/remarkup/blockrule/PhutilRemarkupDefaultBlockRule.php index 44fc977..38de7e1 100644 --- a/src/markup/engine/remarkup/blockrule/PhutilRemarkupDefaultBlockRule.php +++ b/src/markup/engine/remarkup/blockrule/PhutilRemarkupDefaultBlockRule.php @@ -1,35 +1,44 @@ 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); } if (!strlen($text)) { 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); } }