Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
Julian Lam
2018-01-11 15:27:01 -05:00
360 changed files with 1451 additions and 493 deletions

View File

@@ -1274,9 +1274,9 @@ describe('Topic\'s', function () {
assert.equal(data.matchCount, 3);
assert.equal(data.pageCount, 1);
var tagData = [
{ value: 'nodebb', color: '', bgColor: '', score: 3 },
{ value: 'nodejs', color: '', bgColor: '', score: 1 },
{ value: 'nosql', color: '', bgColor: '', score: 1 },
{ value: 'nodebb', valueEscaped: 'nodebb', color: '', bgColor: '', score: 3 },
{ value: 'nodejs', valueEscaped: 'nodejs', color: '', bgColor: '', score: 1 },
{ value: 'nosql', valueEscaped: 'nosql', color: '', bgColor: '', score: 1 },
];
assert.deepEqual(data.tags, tagData);

View File

@@ -114,6 +114,15 @@ describe('new Translator(language)', function () {
});
});
it('should not unescape html in parameters', function () {
var translator = Translator.create('en-GB');
var key = '[[pages:tag, some&tag]]';
return translator.translate(key).then(function (translated) {
assert.strictEqual(translated, 'Topics tagged under "some&tag"');
});
});
it('should properly escape and ignore % and \\, in arguments', function () {
var translator = Translator.create('en-GB');