From b2ffc2e326d159a6fec22480744361b60f883dbf Mon Sep 17 00:00:00 2001 From: jamesbloomer Date: Thu, 21 Nov 2013 13:50:30 +0000 Subject: [PATCH] Allow newline when quotes are used at start of a sentence closes #974 --- core/shared/vendor/showdown/extensions/github.js | 2 +- core/test/unit/client_showdown_int_spec.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/shared/vendor/showdown/extensions/github.js b/core/shared/vendor/showdown/extensions/github.js index 34c1f79265..f7138e5a90 100644 --- a/core/shared/vendor/showdown/extensions/github.js +++ b/core/shared/vendor/showdown/extensions/github.js @@ -52,7 +52,7 @@ }); // in very clear cases, let newlines become
tags - text = text.replace(/^[\w\<][^\n]*\n+/gm, function (x) { + text = text.replace(/^[\w\<\"\'][^\n]*\n+/gm, function (x) { return x.match(/\n{2}/) ? x : x.trim() + " \n"; }); diff --git a/core/test/unit/client_showdown_int_spec.js b/core/test/unit/client_showdown_int_spec.js index 1966793ab3..67c3e1cdeb 100644 --- a/core/test/unit/client_showdown_int_spec.js +++ b/core/test/unit/client_showdown_int_spec.js @@ -95,7 +95,9 @@ describe("Showdown client side converter", function () { it("should turn newlines into br tags in simple cases", function () { var testPhrases = [ {input: "fizz\nbuzz", output: /^

fizz
\nbuzz<\/p>$/}, - {input: "Hello world\nIt's a fine day", output: /^

Hello world
\nIt\'s a fine day<\/p>$/} + {input: "Hello world\nIt's a fine day", output: /^

Hello world
\nIt\'s a fine day<\/p>$/}, + {input: "\"first\nsecond", output: /^

\"first
\nsecond<\/p>$/}, + {input: "\'first\nsecond", output: /^

\'first
\nsecond<\/p>$/} ], processedMarkup;