0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Switch Showdown to fork

fixes #2312

- showdown fork understands more html tags
This commit is contained in:
Hannah Wolfe 2014-03-19 23:22:36 +00:00
parent ec3aabb384
commit 6c3c0a5f6c
3 changed files with 25 additions and 3 deletions

View file

@ -14,7 +14,7 @@
"lodash": "2.4.1",
"moment": "2.4.0",
"nprogress": "0.1.2",
"showdown": "0.3.1",
"showdown": "git://github.com/ErisDS/showdown.git#ghost",
"validator-js": "3.4.0"
}
}

View file

@ -212,7 +212,7 @@ describe("Showdown client side converter", function () {
var testPhrases = [
{
input: "[Google][1]\n\n[1]: http://google.co.uk",
output: /^<p><a href="http:\/\/google.co.uk">Google<\/a><\/p>$/,
output: /^<p><a href="http:\/\/google.co.uk">Google<\/a><\/p>$/
},
{
input: "[Google][1]\n\n[1]: http://google.co.uk \"some text\"",
@ -456,4 +456,26 @@ describe("Showdown client side converter", function () {
processedMarkup.should.match(testPhrase.output);
});
});
it("should output block HTML untouched", function () {
var testPhrases = [
{
input: "<table class=\"test\">\n <tr>\n <td>Foo</td>\n </tr>\n <tr>\n <td>Bar</td>\n </tr>\n</table>",
output: /^<table class=\"test\"> \n <tr>\n <td>Foo<\/td>\n <\/tr>\n <tr>\n <td>Bar<\/td>\n <\/tr>\n<\/table>$/
},
{
input: "<hr />",
output: /^<hr \/>$/
},
{ // audio isn't counted as a block tag by showdown so gets wrapped in <p></p>
input: "<audio class=\"podcastplayer\" controls>\n <source src=\"foobar.mp3\" type=\"audio/mp3\" preload=\"none\"></source>\n <source src=\"foobar.off\" type=\"audio/ogg\" preload=\"none\"></source>\n</audio>",
output: /^<audio class=\"podcastplayer\" controls> \n <source src=\"foobar.mp3\" type=\"audio\/mp3\" preload=\"none\"><\/source>\n <source src=\"foobar.off\" type=\"audio\/ogg\" preload=\"none\"><\/source>\n<\/audio>$/,
}
];
testPhrases.forEach(function (testPhrase) {
processedMarkup = converter.makeHtml(testPhrase.input);
processedMarkup.should.match(testPhrase.output);
});
});
});

View file

@ -48,7 +48,7 @@
"nodemailer": "0.5.13",
"rss": "0.2.1",
"semver": "2.2.1",
"showdown": "0.3.1",
"showdown": "git://github.com/ErisDS/showdown.git#ghost",
"sqlite3": "2.2.0",
"unidecode": "0.1.3",
"validator": "3.4.0",