mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-27 18:52:14 +03:00
Updated downsize to 0.0.5
closes #2106 - downsize 0.0.5 contains the fix to accept single quote found inside a double-quote string or vice-versa - created unit tests to properly check this scenario
This commit is contained in:
parent
37b7907c09
commit
4e5c624d9f
@ -110,6 +110,34 @@ describe('Core Helpers', function () {
|
|||||||
rendered.string.should.equal("<p><img src='example.jpg' /></p>");
|
rendered.string.should.equal("<p><img src='example.jpg' /></p>");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
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 = "<p><img src='example.jpg' alt=\"It's me!\" />Hello <strong>World! It's me!</strong></p>",
|
||||||
|
rendered = (
|
||||||
|
helpers.content
|
||||||
|
.call(
|
||||||
|
{ html: html },
|
||||||
|
{ "hash": { "words": "0" } }
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
should.exist(rendered);
|
||||||
|
rendered.string.should.equal("<p><img src='example.jpg' alt=\"It's me!\" /></p>");
|
||||||
|
});
|
||||||
|
|
||||||
|
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 = "<p><img src='example.jpg' alt='A double quote is \"' />Hello <strong>World! It's me!</strong></p>",
|
||||||
|
rendered = (
|
||||||
|
helpers.content
|
||||||
|
.call(
|
||||||
|
{ html: html },
|
||||||
|
{ "hash": { "words": "0" } }
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
should.exist(rendered);
|
||||||
|
rendered.string.should.equal("<p><img src='example.jpg' alt='A double quote is \"' /></p>");
|
||||||
|
});
|
||||||
|
|
||||||
it('can truncate html by character', function () {
|
it('can truncate html by character', function () {
|
||||||
var html = "<p>Hello <strong>World! It's me!</strong></p>",
|
var html = "<p>Hello <strong>World! It's me!</strong></p>",
|
||||||
rendered = (
|
rendered = (
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
"busboy": "0.0.12",
|
"busboy": "0.0.12",
|
||||||
"colors": "0.6.2",
|
"colors": "0.6.2",
|
||||||
"connect-slashes": "1.2.0",
|
"connect-slashes": "1.2.0",
|
||||||
"downsize": "0.0.4",
|
"downsize": "0.0.5",
|
||||||
"express": "3.4.6",
|
"express": "3.4.6",
|
||||||
"express-hbs": "0.7.6",
|
"express-hbs": "0.7.6",
|
||||||
"fs-extra": "0.8.1",
|
"fs-extra": "0.8.1",
|
||||||
|
Loading…
Reference in New Issue
Block a user