Revert "FIX: New line insertion when a line begins with []"

This reverts commit f84630a54d.
This commit is contained in:
Robin Ward 2013-08-26 12:46:15 -04:00
parent 2df2838f40
commit 373b525ec1
2 changed files with 3 additions and 10 deletions

View File

@ -100,7 +100,7 @@ Discourse.Markdown = {
// Linebreaks
var linebreaks = opts.traditional_markdown_linebreaks || Discourse.SiteSettings.traditional_markdown_linebreaks;
if (!linebreaks) {
text = text.replace(/(^[\w<\[][^\n]*\n+)/gim, function(t) {
text = text.replace(/(^[\w<][^\n]*\n+)/gim, function(t) {
if (t.match(/\n{2}/gim)) return t;
return t.replace("\n", " \n");
});

View File

@ -20,7 +20,7 @@ test("basic cooking", function() {
cooked("***hello***", "<p><strong><em>hello</em></strong></p>", "it can do bold and italics at once.");
});
test("Traditional Line Breaks", function() {
test("Line Breaks", function() {
var input = "1\n2\n3";
cooked(input, "<p>1<br>2<br>3</p>", "automatically handles trivial newlines");
@ -34,16 +34,9 @@ test("Traditional Line Breaks", function() {
Discourse.SiteSettings.traditional_markdown_linebreaks = true;
cooked(input, traditionalOutput, "It supports traditional markdown via a Site Setting");
});
test("Line Breaks", function() {
cooked("[] first choice\n[] second choice",
"<p>[] first choice<br>[] second choice</p>",
"it handles new lines correctly with [] options");
});
test("Links", function() {
cooked("EvilTrout: http://eviltrout.com",