0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Merge pull request #1531 from jamesbloomer/issue-974

Allow newline when quotes are used at start of a sentence
This commit is contained in:
Hannah Wolfe 2013-11-22 02:32:58 -08:00
commit 6406eefae7
2 changed files with 4 additions and 2 deletions

View file

@ -52,7 +52,7 @@
});
// in very clear cases, let newlines become <br /> 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";
});

View file

@ -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: /^<p>fizz <br \/>\nbuzz<\/p>$/},
{input: "Hello world\nIt's a fine day", output: /^<p>Hello world <br \/>\nIt\'s a fine day<\/p>$/}
{input: "Hello world\nIt's a fine day", output: /^<p>Hello world <br \/>\nIt\'s a fine day<\/p>$/},
{input: "\"first\nsecond", output: /^<p>\"first <br \/>\nsecond<\/p>$/},
{input: "\'first\nsecond", output: /^<p>\'first <br \/>\nsecond<\/p>$/}
],
processedMarkup;