diff --git a/addon/utils/compile-markdown.js b/addon/utils/compile-markdown.js
index a4c442c36..88f3c3c46 100644
--- a/addon/utils/compile-markdown.js
+++ b/addon/utils/compile-markdown.js
@@ -135,6 +135,7 @@ function compactParagraphs(tokens) {
balance += count(/{{#/g, textWithoutCode);
balance += count(/<[A-Z]/g, textWithoutCode);
+ balance -= count(/[A-Z][^<>]+\/>/g, textWithoutCode);
balance -= count(/{{\//g, textWithoutCode);
balance -= count(/<\/[A-Z]/g, textWithoutCode);
}
diff --git a/tests-node/unit/utils/compile-markdown-test.js b/tests-node/unit/utils/compile-markdown-test.js
index 0552a2827..4223c3c3c 100644
--- a/tests-node/unit/utils/compile-markdown-test.js
+++ b/tests-node/unit/utils/compile-markdown-test.js
@@ -20,6 +20,38 @@ describe('Unit | compile-markdown', function(hooks) {
assert.equal(result, expected);
});
+ it('compacting sequential curly bracket paragraphs - non-void angle bracket children', function() {
+ let input = stripIndent`
+ {{#foo-bar}}{{/foo-bar}}
+
+ {{#foo-bar}}{{/foo-bar}}
+ `;
+
+ let result = compileMarkdown(input, { targetHandlebars: true });
+ let expected = stripIndent`
+
{{#foo-bar}}{{/foo-bar}}
+
{{#foo-bar}}{{/foo-bar}}
+ `;
+
+ assert.equal(result, expected);
+ });
+
+ it('compacting sequential curly bracket paragraphs - self-closing angle bracket children', function() {
+ let input = stripIndent`
+ {{#foo-bar}}{{/foo-bar}}
+
+ {{#foo-bar}}{{/foo-bar}}
+ `;
+
+ let result = compileMarkdown(input, { targetHandlebars: true });
+ let expected = stripIndent`
+ {{#foo-bar}}{{/foo-bar}}
+
{{#foo-bar}}{{/foo-bar}}
+ `;
+
+ assert.equal(result, expected);
+ });
+
it('compacting angle bracket paragraphs', function() {
let input = stripIndent`
@@ -38,6 +70,38 @@ describe('Unit | compile-markdown', function(hooks) {
assert.equal(result, expected);
});
+ it('compacting sequential angle bracket paragraphs - non-void angle bracket children', function() {
+ let input = stripIndent`
+
+
+
+ `;
+
+ let result = compileMarkdown(input, { targetHandlebars: true });
+ let expected = stripIndent`
+
+ `;
+
+ assert.equal(result, expected);
+ });
+
+ it('compacting sequential angle bracket paragraphs - self-closing angle bracket children', function() {
+ let input = stripIndent`
+
+
+
+ `;
+
+ let result = compileMarkdown(input, { targetHandlebars: true });
+ let expected = stripIndent`
+
+ `;
+
+ assert.equal(result, expected);
+ });
+
it('compacting implicit code blocks', function() {
// Surrounding whitespace + 4-space indent = code block in MD
let input = stripIndent`