Commit 2a3c82db authored by Matthieu Fesselier's avatar Matthieu Fesselier

update: use ~ instead of @

parent 62ad7f60
Pipeline #3218 passed with stage
in 28 seconds
......@@ -2,10 +2,10 @@ export default class SIBRoute extends HTMLElement {
constructor() {
super();
this.slashReplace = '@_';
this.colonReplace = '@~';
this.dotReplace = '@!';
this.atReplace = '@@';
this.slashReplace = '~_';
this.colonReplace = '~@';
this.dotReplace = '~!';
this.tildeReplace = '~~';
}
connectedCallback() {
this.addEventListener('click', event => this.router.navigate(this.name));
......@@ -39,7 +39,7 @@ export default class SIBRoute extends HTMLElement {
encodeId(id) {
if (!id) return '';
return '@' + id.replace(/\@/g, this.atReplace)
return '@' + id.replace(/\~/g, this.tildeReplace)
.replace(/\./g, this.dotReplace)
.replace(/\//g, this.slashReplace)
.replace(/\:/g, this.colonReplace);
......@@ -50,7 +50,7 @@ export default class SIBRoute extends HTMLElement {
return id.replace(new RegExp(`\\${this.colonReplace}`, 'g'), ':')
.replace(new RegExp(`\\${this.slashReplace}`, 'g'), '/')
.replace(new RegExp(`\\${this.dotReplace}`, 'g'), '.')
.replace(new RegExp(`\\${this.atReplace}`, 'g'), '@')
.replace(new RegExp(`\\${this.tildeReplace}`, 'g'), '~')
.replace(/^@/, '');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment