diff --git a/src/app/components/stream/status/databinded-text/databinded-text.component.spec.ts b/src/app/components/stream/status/databinded-text/databinded-text.component.spec.ts
index 7797d62e..a27ebcf0 100644
--- a/src/app/components/stream/status/databinded-text/databinded-text.component.spec.ts
+++ b/src/app/components/stream/status/databinded-text/databinded-text.component.spec.ts
@@ -67,6 +67,13 @@ describe('DatabindedTextComponent', () => {
expect(component.processedText).toContain('
Test.
peertube.fr/videos/watch/69bb6
');
});
+ it('should parse link with special character', () => {
+ const sample = `Magnitude: 2.5 Depth: 3.4 km
Details: 2018/09/27 06:50:17 34.968N 120.685W
Location: 10 km (6 mi) W of Guadalupe, CA
Map: https://www.google.com/maps/place/34°58'4%20N+120°41'6%20W/@34.968,-120.685,10z
#EarthQuake #Quake #California
`;
+
+ component.text = sample;
+ expect(component.processedText).toContain('google.com/maps/place/34°58\'4%');
+ });
+
it('should parse combined hashtag, mention and link', () => {
const hashtag = 'programmers';
const hashtagUrl = 'https://test.social/tags/programmers';
@@ -92,10 +99,12 @@ describe('DatabindedTextComponent', () => {
expect(component.processedText).toContain('bla1');
});
- it('shoult parse mention - Pleroma in Mastodon', () => {
+ it('should parse mention - Pleroma in Mastodon', () => {
const sample = ``;
component.text = sample;
expect(component.processedText).toContain('');
});
+
+
});
diff --git a/src/app/components/stream/status/databinded-text/databinded-text.component.ts b/src/app/components/stream/status/databinded-text/databinded-text.component.ts
index 67fb060a..3b6d6b8f 100644
--- a/src/app/components/stream/status/databinded-text/databinded-text.component.ts
+++ b/src/app/components/stream/status/databinded-text/databinded-text.component.ts
@@ -176,7 +176,7 @@ export class DatabindedTextComponent implements OnInit {
}
private getClassNameForLink(value: string): string {
- let res = value.replace(/[.,\/#?!@$%+\^&\*;:{}=\-_`~()]/g, "");
+ let res = value.replace(/[.,\/#?!@°$%+\'\^&\*;:{}=\-_`~()]/g, "");
return `link-${res}`;
}