From 717f57c9685cc74460196077752310e9f497b3dd Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 28 Jul 2014 13:17:39 -0400 Subject: [PATCH] Revert "FIX: You couldn't span multiple lines with bold or italics" This reverts commit 423d37a2b6dae825b24bbfe9f226e0aec0d212a5. Conflicts: test/javascripts/lib/markdown_test.js --- .../javascripts/discourse/dialects/bold_italics_dialect.js | 2 +- test/javascripts/lib/markdown_test.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/dialects/bold_italics_dialect.js b/app/assets/javascripts/discourse/dialects/bold_italics_dialect.js index c77e3fde3b3..c23d277c2d6 100644 --- a/app/assets/javascripts/discourse/dialects/bold_italics_dialect.js +++ b/app/assets/javascripts/discourse/dialects/bold_italics_dialect.js @@ -23,7 +23,7 @@ var replaceMarkdown = function(match, tag) { } var endText = new RegExp("[^\\s|" + match[0] + "]" + match.replace(/\*/g,"\\*") + "([^" + match[0] + "]|$)"); - var finish = text.search(endText); + var finish = text.split("\n")[0].search(endText); if(finish && finish >= 0) { var newText = text.substring(match.length,finish+1); newText = this.processInline(newText); diff --git a/test/javascripts/lib/markdown_test.js b/test/javascripts/lib/markdown_test.js index 238793a8f08..f8b22858138 100644 --- a/test/javascripts/lib/markdown_test.js +++ b/test/javascripts/lib/markdown_test.js @@ -278,7 +278,9 @@ test("bold and italics", function() { }); test("New Lines", function() { - cooked("_abc\ndef_", "

abc
def

", "it allows markup to span new lines"); + // Note: This behavior was discussed and we determined it does not make sense to do this + // unless you're using traditional line breaks + cooked("_abc\ndef_", "

_abc
def_

", "it does not allow markup to span new lines"); cooked("_abc\n\ndef_", "

_abc

\n\n

def_

", "it does not allow markup to span new paragraphs"); });