From 74b860519d8ae2a56145dfb35794404c0655c245 Mon Sep 17 00:00:00 2001
From: epriestley
Date: Mon, 9 Feb 2015 07:52:39 -0800
Subject: [PATCH] Remarkup: Correctly render inline embed layout
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Summary:
The generated HTML is like `some text
…
more text
`, and HTML `` tags may not contain block content like `` tags. Browsers actually parse this as if it was `some text
…
more text` (sic).
The layout CSS class already has `display: inline` set, but this is not sufficient. Browser's HTML parser doesn't care what CSS rules will be applied, it only deals with the meanings of tags.
Fixes T7201.
Test Plan:
Verify that the following displays the image inline:
`some text {Fnnn,layout=inline} more text`
Reviewers: chad, epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Projects: #remarkup
Maniphest Tasks: T7201
Differential Revision: https://secure.phabricator.com/D11706
---
.../files/markup/PhabricatorEmbedFileRemarkupRule.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php b/src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php
index 52468b5384..f8efaa1a14 100644
--- a/src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php
+++ b/src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php
@@ -160,7 +160,7 @@ final class PhabricatorEmbedFileRemarkupRule
}
return phutil_tag(
- 'div',
+ ($options['layout'] == 'inline' ? 'span' : 'div'),
array(
'class' => $layout_class,
),