Skip to content

Commit

Permalink
Merge pull request TryGhost#2452 from ErisDS/typography
Browse files Browse the repository at this point in the history
Removing typography extension
  • Loading branch information
ErisDS committed Mar 20, 2014
2 parents 39957a7 + d8f724d commit 45361e6
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 124 deletions.
2 changes: 0 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ var path = require('path'),
'bower_components/validator-js/validator.js',

'core/client/assets/lib/showdown/extensions/ghostdown.js',
'core/shared/lib/showdown/extensions/typography.js',
'core/shared/lib/showdown/extensions/github.js',

// ToDo: Remove or replace
Expand Down Expand Up @@ -524,7 +523,6 @@ var path = require('path'),
'bower_components/validator-js/validator.js',

'core/client/assets/lib/showdown/extensions/ghostdown.js',
'core/shared/lib/showdown/extensions/typography.js',
'core/shared/lib/showdown/extensions/github.js',

// ToDo: Remove or replace
Expand Down
2 changes: 1 addition & 1 deletion core/client/assets/lib/editor/htmlPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'use strict';

var HTMLPreview = function (markdown, uploadMgr) {
var converter = new Showdown.converter({extensions: ['typography', 'ghostdown', 'github']}),
var converter = new Showdown.converter({extensions: ['ghostdown', 'github']}),
preview = document.getElementsByClassName('rendered-markdown')[0],
update;

Expand Down
3 changes: 1 addition & 2 deletions core/server/models/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ var _ = require('lodash'),
errors = require('../errorHandling'),
Showdown = require('showdown'),
github = require('../../shared/lib/showdown/extensions/github'),
typography = require('../../shared/lib/showdown/extensions/typography'),
converter = new Showdown.converter({extensions: [typography, github]}),
converter = new Showdown.converter({extensions: [github]}),
User = require('./user').User,
Tag = require('./tag').Tag,
Tags = require('./tag').Tags,
Expand Down
114 changes: 0 additions & 114 deletions core/shared/lib/showdown/extensions/typography.js

This file was deleted.

10 changes: 5 additions & 5 deletions core/test/functional/frontend/feed_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CasperTest.begin('Ensure that RSS is available', 11, function suite(test) {
siteDescription = '<description><![CDATA[Just a blogging platform.]]></description>',
siteUrl = '<link>http://127.0.0.1:2369/</link>',
postTitle = '<![CDATA[Welcome to Ghost]]>',
postStart = '<description><![CDATA[<p>Youre live!',
postStart = '<description><![CDATA[<p>You\'re live!',
postEnd = 'you think :)</p>]]></description>',
postLink = '<link>http://127.0.0.1:2369/welcome-to-ghost/</link>',
postCreator = '<dc:creator><![CDATA[Test User]]>';
Expand All @@ -29,17 +29,17 @@ CasperTest.begin('Ensure that RSS is available', 11, function suite(test) {
});
}, false);

CasperTest.begin('Ensure that author element is not included. Only dc:creator', 3, function suite(test) {
CasperTest.begin('Ensure that author element is not included. Only dc:creator', 3, function suite(test) {
CasperTest.Routines.togglePermalinks.run('off');
casper.thenOpen(url + 'rss/', function (response) {
casper.thenOpen(url + 'rss/', function (response) {
var content = this.getPageContent(),
author = '<author>',
postCreator = '<dc:creator><![CDATA[Test User]]>';

test.assertEqual(response.status, 200, 'Response status should be 200.');
test.assert(content.indexOf(author) < 0, 'Author element should not be included');
test.assert(content.indexOf(postCreator) >= 0, 'Welcome post should have Test User as the creator.');
});
test.assert(content.indexOf(postCreator) >= 0, 'Welcome post should have Test User as the creator.');
});
}, false);

CasperTest.begin('Ensures dated permalinks works with RSS', 2, function suite(test) {
Expand Down
15 changes: 15 additions & 0 deletions core/test/unit/client_showdown_int_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,4 +478,19 @@ describe("Showdown client side converter", function () {
processedMarkup.should.match(testPhrase.output);
});
});


// Waiting for showdown typography to be updated
// it("should correctly convert quotes to curly quotes", function () {
// var testPhrases = [
// {
// input: "Hello world\nIt's a fine day\nout",
// output: /^<p>Hello world <br \/>\nIt’s a fine day <br \/>\nout<\/p>$/}
// ];
//
// testPhrases.forEach(function (testPhrase) {
// processedMarkup = converter.makeHtml(testPhrase.input);
// processedMarkup.should.match(testPhrase.output);
// });
// })
});

0 comments on commit 45361e6

Please sign in to comment.