diff --git a/core/test/unit/server_helpers_index_spec.js b/core/test/unit/server_helpers_index_spec.js index eb75a331e8..8e5a293e30 100644 --- a/core/test/unit/server_helpers_index_spec.js +++ b/core/test/unit/server_helpers_index_spec.js @@ -110,6 +110,34 @@ describe('Core Helpers', function () { rendered.string.should.equal("
"); }); + it('can truncate html to 0 words, leaving image tag if it is first and if it has an alt text with a single quote in the string', function () { + var html = "Hello World! It's me!
", + rendered = ( + helpers.content + .call( + { html: html }, + { "hash": { "words": "0" } } + ) + ); + + should.exist(rendered); + rendered.string.should.equal(""); + }); + + it('can truncate html to 0 words, leaving image tag if it is first and if it has an alt text with a double quote in the string', function () { + var html = "Hello World! It's me!
", + rendered = ( + helpers.content + .call( + { html: html }, + { "hash": { "words": "0" } } + ) + ); + + should.exist(rendered); + rendered.string.should.equal(""); + }); + it('can truncate html by character', function () { var html = "Hello World! It's me!
", rendered = ( diff --git a/package.json b/package.json index aef7b25160..da067e0fd1 100644 --- a/package.json +++ b/package.json @@ -1,87 +1,87 @@ -{ - "name" : "ghost", - "version" : "0.4.1", - "description" : "Just a blogging platform.", - "author" : "Ghost Foundation", - "homepage" : "http://ghost.org", - "keywords" : [ - "ghost", - "blog", - "cms" - ], - "repository" : { - "type": "git", - "url": "git://github.com/TryGhost/Ghost.git" - }, - "bugs" : "https://github.com/TryGhost/Ghost/issues", - "contributors": "https://github.com/TryGhost/Ghost/graphs/contributors", - "private" : true, - "licenses" : [ - { - "type": "MIT", - "url": "https://raw.github.com/TryGhost/Ghost/master/LICENSE" - } - ], - "main": "./core/index", - "scripts": { - "start": "node index", - "test": "grunt validate --verbose" - }, - "engines": { - "node": "~0.10.0" - }, - "engineStrict": true, - "dependencies": { - "bcryptjs": "0.7.10", - "bookshelf": "0.6.1", - "busboy": "0.0.12", - "colors": "0.6.2", - "connect-slashes": "1.2.0", - "downsize": "0.0.4", - "express": "3.4.6", - "express-hbs": "0.7.6", - "fs-extra": "0.8.1", - "knex": "0.5.0", - "moment": "2.4.0", - "node-polyglot": "0.3.0", - "node-uuid": "1.4.1", - "nodemailer": "0.5.13", - "rss": "0.2.1", - "semver": "2.2.1", - "showdown": "0.3.1", - "sqlite3": "2.2.0", - "lodash": "2.4.1", - "unidecode": "0.1.3", - "validator": "1.4.0", - "when": "2.7.0" - }, - "optionalDependencies": { - "mysql": "2.0.0-alpha9" - }, - "devDependencies": { - "blanket": "~1.1.5", - "grunt": "~0.4.1", - "grunt-contrib-clean": "~0.5.0", - "grunt-contrib-compress": "~0.5.2", - "grunt-contrib-concat": "~0.3.0", - "grunt-contrib-copy": "~0.4.1", - "grunt-contrib-handlebars": "~0.6.0", - "grunt-contrib-sass": "~0.5.0", - "grunt-contrib-uglify": "~0.2.5", - "grunt-contrib-watch": "~0.5.3", - "grunt-express-server": "~0.4.11", - "grunt-groc": "~0.4.0", - "grunt-jslint": "~1.1.1", - "grunt-mocha-cli": "~1.4.0", - "grunt-shell": "~0.6.1", - "grunt-update-submodules": "~0.2.1", - "matchdep": "~0.3.0", - "mocha": "~1.15.1", - "rewire": "~2.0.0", - "request": "~2.29.0", - "require-dir": "~0.1.0", - "should": "~2.1.1", - "sinon": "~1.7.3", - "supertest": "~0.8.2" - } -} +{ + "name" : "ghost", + "version" : "0.4.1", + "description" : "Just a blogging platform.", + "author" : "Ghost Foundation", + "homepage" : "http://ghost.org", + "keywords" : [ + "ghost", + "blog", + "cms" + ], + "repository" : { + "type": "git", + "url": "git://github.com/TryGhost/Ghost.git" + }, + "bugs" : "https://github.com/TryGhost/Ghost/issues", + "contributors": "https://github.com/TryGhost/Ghost/graphs/contributors", + "private" : true, + "licenses" : [ + { + "type": "MIT", + "url": "https://raw.github.com/TryGhost/Ghost/master/LICENSE" + } + ], + "main": "./core/index", + "scripts": { + "start": "node index", + "test": "grunt validate --verbose" + }, + "engines": { + "node": "~0.10.0" + }, + "engineStrict": true, + "dependencies": { + "bcryptjs": "0.7.10", + "bookshelf": "0.6.1", + "busboy": "0.0.12", + "colors": "0.6.2", + "connect-slashes": "1.2.0", + "downsize": "0.0.5", + "express": "3.4.6", + "express-hbs": "0.7.6", + "fs-extra": "0.8.1", + "knex": "0.5.0", + "moment": "2.4.0", + "node-polyglot": "0.3.0", + "node-uuid": "1.4.1", + "nodemailer": "0.5.13", + "rss": "0.2.1", + "semver": "2.2.1", + "showdown": "0.3.1", + "sqlite3": "2.2.0", + "lodash": "2.4.1", + "unidecode": "0.1.3", + "validator": "1.4.0", + "when": "2.7.0" + }, + "optionalDependencies": { + "mysql": "2.0.0-alpha9" + }, + "devDependencies": { + "blanket": "~1.1.5", + "grunt": "~0.4.1", + "grunt-contrib-clean": "~0.5.0", + "grunt-contrib-compress": "~0.5.2", + "grunt-contrib-concat": "~0.3.0", + "grunt-contrib-copy": "~0.4.1", + "grunt-contrib-handlebars": "~0.6.0", + "grunt-contrib-sass": "~0.5.0", + "grunt-contrib-uglify": "~0.2.5", + "grunt-contrib-watch": "~0.5.3", + "grunt-express-server": "~0.4.11", + "grunt-groc": "~0.4.0", + "grunt-jslint": "~1.1.1", + "grunt-mocha-cli": "~1.4.0", + "grunt-shell": "~0.6.1", + "grunt-update-submodules": "~0.2.1", + "matchdep": "~0.3.0", + "mocha": "~1.15.1", + "rewire": "~2.0.0", + "request": "~2.29.0", + "require-dir": "~0.1.0", + "should": "~2.1.1", + "sinon": "~1.7.3", + "supertest": "~0.8.2" + } +}