Skip to content

Commit

Permalink
fix elastic#7332 - saving vis with % in name causes error
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar committed Jul 10, 2016
1 parent fe4dea3 commit db32541
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/ui/public/utils/__tests__/slugify_id.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,22 @@ describe('slugifyId()', function () {
['test?test', 'test-questionmark-test'],
['test=test', 'test-equal-test'],
['test&test', 'test-ampersand-test'],
['test%test', 'test-percent-test'],
['test / test', 'test-slash-test'],
['test ? test', 'test-questionmark-test'],
['test = test', 'test-equal-test'],
['test & test', 'test-ampersand-test'],
['test % test', 'test-percent-test'],
['test / ^test', 'test-slash-^test'],
['test ? test', 'test-questionmark-test'],
['test = test', 'test-equal-test'],
['test & test', 'test-ampersand-test'],
['test % test', 'test-percent-test'],
['test/test/test', 'test-slash-test-slash-test'],
['test?test?test', 'test-questionmark-test-questionmark-test'],
['test&test&test', 'test-ampersand-test-ampersand-test'],
['test=test=test', 'test-equal-test-equal-test']
['test=test=test', 'test-equal-test-equal-test'],
['test%test%test', 'test-percent-test-percent-test']
];

_.each(fixtures, function (fixture) {
Expand Down
3 changes: 2 additions & 1 deletion src/ui/public/utils/slugify_id.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export default function (id) {
'/' : '-slash-',
'\\?' : '-questionmark-',
'\\&' : '-ampersand-',
'=' : '-equal-'
'=' : '-equal-',
'%' : '-percent-'
};
_.each(trans, function (val, key) {
let regex = new RegExp(key, 'g');
Expand Down

0 comments on commit db32541

Please sign in to comment.