+
{{ short_date(proj.started_at) }}
@@ -90,6 +90,7 @@ import { Project } from '../model/projects';
import { tID } from '../model/skills';
import * as projects from '../service/projects';
import * as scroller from '../service/scroller';
+import * as url from '../service/url';
interface TimeDiff {
diff: number;
@@ -227,6 +228,11 @@ export default class Timeline extends Vue {
header.classList.remove('fixed');
}
}
+
+ protected sanitize(raw: string): string {
+ return url.sanitize(raw);
+ }
+
}
diff --git a/src/service/url.ts b/src/service/url.ts
new file mode 100644
index 0000000..76ec500
--- /dev/null
+++ b/src/service/url.ts
@@ -0,0 +1,5 @@
+// sanitizes an url
+export function sanitize(raw: string): string {
+ const invalid = /[\*\s\(\)]/g
+ return encodeURIComponent(raw.replaceAll(invalid, '_'));
+}
\ No newline at end of file