Compare commits

...

22 Commits

Author SHA1 Message Date
Nils Knappmeier 5a427d2d2b v3.0.6 2019-01-02 10:17:56 +01:00
Nils Knappmeier 26de7bdb3d Update release notes 2019-01-02 10:17:34 +01:00
Nils Knappmeier 6e9dbac8e9 Revert "Escape = in HTML content"
This reverts commit 1c863e34, a change that was illegal in a patch (by semver semantics).

see #1489
2019-01-02 10:01:53 +01:00
Nils Knappmeier af919d2348 chore: ignore idea config 2019-01-02 09:40:12 +01:00
Nils Knappmeier df403ed203 chore: add publishConfig to prevent publishing 3.x as "latest"
see #1486
2019-01-02 09:23:01 +01:00
Nils Knappmeier 9679fe6909 chore: update components/handlebars package.json on release 2019-01-02 01:27:49 +01:00
Nils Knappmeier 928320524f chore: fix travis build
- bump to mocha 1.21.5 in order to remove "*" version-range on the
  "debug"-dependency
- explicit use of "dot"-reporter for mocha 1.21.5, fixes failing tests
  of console.log output
- fix tests running in the browser: assign variable "global" with
  global "this", backport from master-branch
- sync saucelab config with master branch:
  - Remove Safari 6 and 7 that are not supported by saucelabs anymore
    and cause timeouts when running the saucelabs tests.
  - Add Safari 8 and Safari 9
  - Note: The tests fail with Safari 9 and 10 because in these versions
    the "column"-property of "Error" is read-only
    (see https://github.com/jquery/esprima/issues/1290)
  - Firefox needs explicit platform specifier
2019-01-02 01:27:49 +01:00
Nils Knappmeier 725986da22 fix: gracefully handle read-only "column"-property of the Error class
- this is the case in Safari starting with version 9.0
- see 07511e0379dbdeea78f407065b0a3134a79a38a6
- also see #1285
2019-01-02 01:27:49 +01:00
Nils Knappmeier d207ad056a chore: add active NodeJS versions to travis
- 8.x and 6.x
2019-01-02 01:27:49 +01:00
Nils Knappmeier 64254b604b v3.0.5 2018-12-15 14:16:13 +01:00
Nils Knappmeier 878e980c0f Update release notes 2018-12-15 14:15:54 +01:00
Nils Knappmeier f6b5a288b4 docs: bump node version used in release 2018-12-15 14:13:57 +01:00
Nils Knappmeier 4ed0a625e3 chore: use node 10.x in travis-build 2018-12-15 14:08:55 +01:00
Nils Knappmeier e97741f9ab docs: add notes about required tools and versions for a release 2018-12-15 14:02:14 +01:00
Nils Knappmeier 698c8a93a4 v3.0.4 2018-12-15 13:55:00 +01:00
Nils Knappmeier 12cd4ef010 Update release notes 2018-12-15 13:54:17 +01:00
Nils Knappmeier ed9e301eb8 chore: add wepback@1.x to devDependencies
This is required by some other dependencies as
peerDependencies, which are not automatically installed
anymore since npm@3
2018-12-15 13:39:45 +01:00
Nils Knappmeier bbe684b7c7 chore: remove TODO comment line
This comment is not relevant for 3.x anymore, since this
release will only get bugfixes and not major refactorings.
It breaks the build though.
2018-12-15 13:35:26 +01:00
Nils Knappmeier f8d7b381dc docs: update CONTRIBUTING.md from master and add text about 3.x 2018-12-15 13:20:20 +01:00
kpdecker 4cd5305c7f Further relax uglify dependency 2016-04-11 13:22:17 +01:00
Paul Lynch d97c2e6dc0 Update uglify-js to avoid vulnerability 2016-04-11 13:22:04 +01:00
kpdecker 1c863e34ab Escape = in HTML content
There was a potential XSS exploit when using unquoted attributes that this should help reduce.

Fixes #1083
2016-02-08 18:56:04 +00:00
16 changed files with 157 additions and 18 deletions
+1
View File
@@ -10,3 +10,4 @@ node_modules
*.sublime-workspace
npm-debug.log
sauce_connect.log*
/.idea/
+3 -1
View File
@@ -13,11 +13,13 @@ env:
- secure: Nm4AgSfsgNB21kgKrF9Tl7qVZU8YYREhouQunFracTcZZh2NZ2XH5aHuSiXCj88B13Cr/jGbJKsZ4T3QS3wWYtz6lkyVOx3H3iI+TMtqhD9RM3a7A4O+4vVN8IioB2YjhEu0OKjwgX5gp+0uF+pLEi7Hpj6fupD3AbbL5uYcKg8=
matrix:
include:
- node_js: '0.10'
- node_js: '10'
env:
- PUBLISH=true
- secure: pLTzghtVll9yGKJI0AaB0uI8GypfWxLTaIB0ZL8//yN3nAEIKMhf/RRilYTsn/rKj2NUa7vt2edYILi3lttOUlCBOwTc9amiRms1W8Lwr/3IdWPeBLvLuH1zNJRm2lBAwU4LBSqaOwhGaxOQr6KHTnWudhNhgOucxpZfvfI/dFw=
- secure: yERYCf7AwL11D9uMtacly/THGV8BlzsMmrt+iQVvGA3GaY6QMmfYqf6P6cCH98sH5etd1Y+1e6YrPeMjqI6lyRllT7FptoyOdHulazQe86VQN4sc0EpqMlH088kB7gGjTut9Z+X9ViooT5XEh9WA5jXEI9pXhQJNoIHkWPuwGuY=
- node_js: '8'
- node_js: '6'
cache:
directories:
- node_modules
+36 -1
View File
@@ -6,10 +6,18 @@ Please see our [FAQ](https://github.com/wycats/handlebars.js/blob/master/FAQ.md)
Should you run into other issues with the project, please don't hesitate to let us know by filing an [issue][issue]! In general we are going to ask for an example of the problem failing, which can be as simple as a jsfiddle/jsbin/etc. We've put together a jsfiddle [template][jsfiddle] to ease this. (We will keep this link up to date as new releases occur, so feel free to check back here)
Pull requests containing only failing thats demonstrating the issue are welcomed and this also helps ensure that your issue won't regress in the future once it's fixed.
Pull requests containing only failing tests demonstrating the issue are welcomed and this also helps ensure that your issue won't regress in the future once it's fixed.
Documentation issues on the handlebarsjs.com site should be reported on [handlebars-site](https://github.com/wycats/handlebars-site).
## Branches
* The branch `4.x` contains the currently released version. Bugfixes should be made in this branch.
* The branch `master` contains the next version. A release date is not yet specified. Maintainers
should merge the branch `4.x` into the master branch regularly.
* The branch `3.x` contains the previous release. Relevant bugfixes may be cherry-picked into this
branch from the `4.x` branch. There should be no merges anymore between this branch and `4.x` or `master`.
## Pull Requests
We also accept [pull requests][pull-request]!
@@ -42,6 +50,25 @@ The `grunt dev` implements watching for tests and allows for in browser testing
If you notice any problems, please report them to the GitHub issue tracker at
[http://github.com/wycats/handlebars.js/issues](http://github.com/wycats/handlebars.js/issues).
## Running Tests
To run tests locally, first install all dependencies.
```sh
npm install
```
Clone the mustache specs into the spec/mustache folder.
```sh
cd spec
rm -r mustache
git clone https://github.com/mustache/spec.git mustache
```
From the root directory, run the tests.
```sh
npm test
```
## Ember testing
The current ember distribution should be tested as part of the handlebars release process. This requires building the `handlebars-source` gem locally and then executing the ember test script.
@@ -60,6 +87,14 @@ npm test
Handlebars utilizes the [release yeoman generator][generator-release] to perform most release tasks.
Before starting the release, make sure that the `yo`, `generator-release` and `grunt` are installed globally.
The last release was successfully performed with `yo@2.0.5`, `generator-release@2.6.1` and `grunt@1.0.3` and `node@10.11.0`.
If the latest versions of the tools don't work you may want to revert to those versions.
```bash
npm install -g yo generator-release grunt
```
A full release may be completed with the following:
```
+5 -4
View File
@@ -161,9 +161,9 @@ module.exports = function(grunt) {
concurrency: 2,
browsers: [
{browserName: 'chrome'},
{browserName: 'firefox'},
{browserName: 'safari', version: 7, platform: 'OS X 10.9'},
{browserName: 'safari', version: 6, platform: 'OS X 10.8'},
{browserName: 'firefox', platform: 'Linux'},
{browserName: 'safari', version: 9, platform: 'OS X 10.11'},
{browserName: 'safari', version: 8, platform: 'OS X 10.10'},
{browserName: 'internet explorer', version: 11, platform: 'Windows 8.1'},
{browserName: 'internet explorer', version: 10, platform: 'Windows 8'},
{browserName: 'internet explorer', version: 9, platform: 'Windows 7'}
@@ -177,7 +177,8 @@ module.exports = function(grunt) {
detailedError: true,
concurrency: 2,
browsers: [
{browserName: 'chrome'}
{browserName: 'chrome'},
{browserName: 'internet explorer', version: 10, platform: 'Windows 8'}
]
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "handlebars",
"version": "3.0.3",
"version": "3.0.6",
"main": "handlebars.js",
"dependencies": {}
}
+1 -1
View File
@@ -2,7 +2,7 @@
<package>
<metadata>
<id>handlebars.js</id>
<version>3.0.3</version>
<version>3.0.6</version>
<authors>handlebars.js Authors</authors>
<licenseUrl>https://github.com/wycats/handlebars.js/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/wycats/handlebars.js/</projectUrl>
+19
View File
@@ -0,0 +1,19 @@
{
"version": "3.0.6",
"license": "MIT",
"jspm": {
"main": "handlebars",
"shim": {
"handlebars": {
"exports": "Handlebars"
}
},
"files": [
"handlebars.js",
"handlebars.runtime.js"
],
"buildConfig": {
"minify": true
}
}
}
+18 -3
View File
@@ -19,13 +19,28 @@ function Exception(message, node) {
this[errorProps[idx]] = tmp[errorProps[idx]];
}
/* istanbul ignore else */
if (Error.captureStackTrace) {
Error.captureStackTrace(this, Exception);
}
if (loc) {
this.lineNumber = line;
this.column = column;
try {
if (loc) {
this.lineNumber = line;
// Work around issue under safari where we can't directly set the column value
/* istanbul ignore next */
if (Object.defineProperty) {
Object.defineProperty(this, 'column', {
value: column,
enumerable: true
});
} else {
this.column = column;
}
}
} catch (nop) {
/* Ignore if the browser is very particular */
}
}
-2
View File
@@ -20,8 +20,6 @@ export function checkRevision(compilerInfo) {
}
}
// TODO: Remove this line and break up compilePartial
export function template(templateSpec, env) {
/* istanbul ignore next */
if (!env) {
+2
View File
@@ -5,6 +5,8 @@ const escape = {
'"': '&quot;',
"'": '&#x27;',
'`': '&#x60;'
// The "equals-sign" is intentionally excluded from this list
// due to semantic-versioning issues (see #1489)
};
const badChars = /[&<>"'`]/g,
+9 -4
View File
@@ -1,7 +1,7 @@
{
"name": "handlebars",
"barename": "handlebars",
"version": "3.0.3",
"version": "3.0.6",
"description": "Handlebars provides the power necessary to let you build semantic templates effectively with no frustration",
"homepage": "http://www.handlebarsjs.com/",
"keywords": [
@@ -10,6 +10,9 @@
"template",
"html"
],
"publishConfig": {
"tag": "legacy"
},
"repository": {
"type": "git",
"url": "https://github.com/wycats/handlebars.js.git"
@@ -25,7 +28,7 @@
"source-map": "^0.1.40"
},
"optionalDependencies": {
"uglify-js": "~2.3"
"uglify-js": "^2.6"
},
"devDependencies": {
"async": "^0.9.0",
@@ -51,10 +54,12 @@
"istanbul": "^0.3.0",
"jison": "~0.3.0",
"keen.io": "0.0.3",
"mocha": "~1.20.0",
"mocha": "~1.21.5",
"mustache": "0.x",
"semver": "^4.0.0",
"underscore": "^1.5.1"
"underscore": "^1.5.1",
"webpack": "^1.15.0",
"webpack-dev-server": "^1.16.5"
},
"main": "lib/index.js",
"bin": {
+39 -1
View File
@@ -2,7 +2,45 @@
## Development
[Commits](https://github.com/wycats/handlebars.js/compare/v3.0.3...master)
[Commits](https://github.com/wycats/handlebars.js/compare/v3.0.6...master)
## v3.0.6 - January 2nd, 2019
Chore:
- prevent tagging 3.x versions as "latest" in npm - df403ed, [#1486](https://github.com/wycats/handlebars.js/issues/1486)
- ignore idea config - af919d2
- fix travis build - 9283205
- update components/handlebars package.json on release - 9679fe6
- add active NodeJS versions to travis - d207ad0
Fix:
- No longer escape "=" in HTML content - 6e9dbac, [#1489](https://github.com/wycats/handlebars.js/issues/1489)
- gracefully handle read-only "column"-property of the Error class (required in Safari 9+) - 725986d
Compatibility notes:
- Compatibility to 3.0.5 is broken due to reverting to *not* escaping "=" in HTML,
but compatibility to 3.0.3 is restored.
[Commits](https://github.com/wycats/handlebars.js/compare/v3.0.5...v3.0.6)
## v3.0.5 - December 15th, 2018
- chore: use node 10.x in travis-build - 4ed0a62
Compatibility notes:
- no breaking changes
[Commits](https://github.com/wycats/handlebars.js/compare/v3.0.4...v3.0.5)
## v3.0.4 - December 15th, 2018
- Further relax uglify dependency - 4cd5305
- Update uglify-js to avoid vulnerability - d97c2e6
- Escape = in HTML content - 1c863e3
Compatibility notes:
- No breaking changes
[Commits](https://github.com/wycats/handlebars.js/compare/v3.0.3...v3.0.4)
## v3.0.3 - April 28th, 2015
- [#1004](https://github.com/wycats/handlebars.js/issues/1004) - Latest version breaks with RequireJS (global is undefined) ([@boskee](https://api.github.com/users/boskee))
+18
View File
@@ -1,3 +1,21 @@
var global = (function() { return this; }());
var AssertError;
if (Error.captureStackTrace) {
AssertError = function AssertError(message, caller) {
Error.prototype.constructor.call(this, message);
this.message = message;
if (Error.captureStackTrace) {
Error.captureStackTrace(this, caller || AssertError);
}
};
AssertError.prototype = new Error();
} else {
AssertError = Error;
}
global.shouldCompileTo = function(string, hashOrArray, expected, message) {
shouldCompileToWithPartials(string, hashOrArray, false, expected, message);
};
+1
View File
@@ -27,6 +27,7 @@ run('./node', function() {
function run(env, callback) {
var mocha = new Mocha();
mocha.ui('bdd');
mocha.reporter('dot');
mocha.files = files.slice();
if (grep) {
mocha.grep(grep);
+3
View File
@@ -19,6 +19,9 @@ describe('utils', function() {
it('shouhld escape html', function() {
equals(Handlebars.Utils.escapeExpression('foo<&"\'>'), 'foo&lt;&amp;&quot;&#x27;&gt;');
});
it('should not escape the equals-sign in 3.x (#1489)', function() {
equals(Handlebars.Utils.escapeExpression('foo='), 'foo=');
});
it('should not escape SafeString', function() {
var string = new Handlebars.SafeString('foo<&"\'>');
equals(Handlebars.Utils.escapeExpression(string), 'foo<&"\'>');
+1
View File
@@ -20,6 +20,7 @@ module.exports = function(grunt) {
async.each([
['lib/handlebars/base.js', /var VERSION = ['"](.*)['"];/, 'var VERSION = "' + version + '";'],
['components/bower.json', /"version":.*/, '"version": "' + version + '",'],
['components/package.json', /"version":.*/, '"version": "' + version + '",'],
['components/handlebars.js.nuspec', /<version>.*<\/version>/, '<version>' + version + '</version>']
],
function(args, callback) {