We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a331908 + 1f96a06 commit 60dbb98Copy full SHA for 60dbb98
src/templates/default.js
@@ -1,7 +1,7 @@
1
JSONEditor.defaults.templates["default"] = function() {
2
return {
3
compile: function(template) {
4
- var matches = template.match(/{{\s*([a-zA-Z0-9\-_\.]+)\s*}}/g);
+ var matches = template.match(/{{\s*([a-zA-Z0-9\-_ \.]+)\s*}}/g);
5
var l = matches && matches.length;
6
7
// Shortcut if the template contains no variables
@@ -11,7 +11,7 @@ JSONEditor.defaults.templates["default"] = function() {
11
// This drastically speeds up template execution
12
var replacements = [];
13
var get_replacement = function(i) {
14
- var p = matches[i].replace(/[{}\s]+/g,'').split('.');
+ var p = matches[i].replace(/[{}]+/g,'').trim().split('.');
15
var n = p.length;
16
var func;
17
0 commit comments