From 24d01d39c62ecd3eba95881790126357ec20f13a Mon Sep 17 00:00:00 2001 From: epriestley Date: Sun, 10 Apr 2011 14:07:00 -0700 Subject: [PATCH] Improve linebreak / paragraph behavior. --- .../parser/markup/DifferentialMarkupEngineFactory.php | 2 ++ .../revisioncomment/DifferentialRevisionCommentView.php | 6 +++++- .../rsrc/css/application/differential/revision-comment.css | 5 +---- webroot/rsrc/css/core/remarkup.css | 6 +++++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/applications/differential/parser/markup/DifferentialMarkupEngineFactory.php b/src/applications/differential/parser/markup/DifferentialMarkupEngineFactory.php index ed65834c50..0764af8c36 100644 --- a/src/applications/differential/parser/markup/DifferentialMarkupEngineFactory.php +++ b/src/applications/differential/parser/markup/DifferentialMarkupEngineFactory.php @@ -21,6 +21,8 @@ class DifferentialMarkupEngineFactory { public function newDifferentialCommentMarkupEngine() { $engine = new PhutilRemarkupEngine(); + $engine->setConfig('preserve-linebreaks', true); + $rules = array(); $rules[] = new PhutilRemarkupRuleEscapeRemarkup(); $rules[] = new PhutilRemarkupRuleHyperlink(); diff --git a/src/applications/differential/view/revisioncomment/DifferentialRevisionCommentView.php b/src/applications/differential/view/revisioncomment/DifferentialRevisionCommentView.php index 331d3bb408..86e81999f7 100644 --- a/src/applications/differential/view/revisioncomment/DifferentialRevisionCommentView.php +++ b/src/applications/differential/view/revisioncomment/DifferentialRevisionCommentView.php @@ -156,7 +156,11 @@ final class DifferentialRevisionCommentView extends AphrontView { $inline_render[] = ''. ''.$lines.''. - ''.$inline_content.''. + ''. + '
'. + $inline_content. + '
'. + ''. ''; } } diff --git a/webroot/rsrc/css/application/differential/revision-comment.css b/webroot/rsrc/css/application/differential/revision-comment.css index 91859cb9e5..488249700f 100644 --- a/webroot/rsrc/css/application/differential/revision-comment.css +++ b/webroot/rsrc/css/application/differential/revision-comment.css @@ -42,10 +42,7 @@ overflow: hidden; } -.differential-comment-core .phabricator-remarkup p { - margin: 0.35em 0; -} - +.differential-comment-content .phabricator-remarkup code, .differential-comment-core .phabricator-remarkup code { width: 88ex; width: 81ch; diff --git a/webroot/rsrc/css/core/remarkup.css b/webroot/rsrc/css/core/remarkup.css index 98ef494542..26eaaf57cb 100644 --- a/webroot/rsrc/css/core/remarkup.css +++ b/webroot/rsrc/css/core/remarkup.css @@ -7,7 +7,11 @@ } .phabricator-remarkup p { - margin: 0 0 .75em; + margin: 0 0 1em; +} + +.phabricator-remarkup p:last-child { + margin-bottom: 0; } .phabricator-remarkup code {