mirror of
https://github.com/Leaflet/Leaflet.git
synced 2025-08-16 16:45:22 +00:00
TileLayer feature: add space to character regex for template to allow Object keys with it (#7216)
This commit is contained in:
@ -229,9 +229,10 @@ describe('Util', function () {
|
||||
}).to.throwError();
|
||||
});
|
||||
|
||||
it('allows underscores and dashes in placeholders', function () {
|
||||
it('allows underscores, dashes and spaces in placeholders', function () {
|
||||
expect(L.Util.template('{nice_stuff}', {'nice_stuff': 'foo'})).to.eql('foo');
|
||||
expect(L.Util.template('{-y}', {'-y': 1})).to.eql('1');
|
||||
expect(L.Util.template('{Day Of Month}', {'Day Of Month': 30})).to.eql('30');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -152,7 +152,7 @@ export function getParamString(obj, existingUrl, uppercase) {
|
||||
return ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&');
|
||||
}
|
||||
|
||||
var templateRe = /\{ *([\w_-]+) *\}/g;
|
||||
var templateRe = /\{ *([\w_ -]+) *\}/g;
|
||||
|
||||
// @function template(str: String, data: Object): String
|
||||
// Simple templating facility, accepts a template string of the form `'Hello {a}, {b}'`
|
||||
|
Reference in New Issue
Block a user