Skip to content

Commit

Permalink
Merge pull request #27 from tbranyen/address-matjas-feedback
Browse files Browse the repository at this point in the history
Address feedback from Mathias.
  • Loading branch information
tbranyen committed May 23, 2014
2 parents 3add68c + d96aaf3 commit 2d8cdab
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"mocha": "~1.18.2",
"requirejs": "~2.1.10",
"assert": "~0.1.0",
"json2": "*"
"json3": "~3.3.1"
},
"ignore": [
"build",
Expand Down
2 changes: 1 addition & 1 deletion build/tasks/karma.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module.exports = ->

files: [
"bower_components/assert/assert.js"
"bower_components/json2/json2.js"
"bower_components/json3/lib/json3.js"
"bower_components/requirejs/require.js"
"test/runner.js"

Expand Down
2 changes: 1 addition & 1 deletion lib/shared/encode.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ define(function(require, exports, module) {

// Identifies all characters in the unicode range: 00A0-9999, ampersands,
// greater & less than) with their respective html entity.
return raw.replace(/[\u00A0-\u9999<>\&]/gm, function(match) {
return raw.replace(/["&'<>`]/g, function(match) {
return "&#" + match.charCodeAt(0) + ";";
});
}
Expand Down
2 changes: 1 addition & 1 deletion test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<!-- Testing libraries. -->
<script src="../bower_components/mocha/mocha.js"></script>
<script src="../bower_components/assert/assert.js"></script>
<script src="../bower_components/json2/json2.js"></script>
<script src="../bower_components/json3/lib/json3.js"></script>
<script src="../bower_components/requirejs/require.js"></script>

<!-- Run the test harness. -->
Expand Down
7 changes: 7 additions & 0 deletions test/tests/properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ define(function(require, exports, module) {
assert.equal(output, "test\ttest\ntest\rtest\r\ntest test");
});

it("does not lose data with encoding", function() {
var tmpl = combyne("{{test}}");
var output = tmpl.render({ test: "\u1D306" });

assert.equal(output, "\u1D306");
});

it("can handle unicode characters", function() {
var tmpl = combyne("{{{test}}}");
var output = tmpl.render({ test: "\u2C64" });
Expand Down

0 comments on commit 2d8cdab

Please sign in to comment.