Commit 5a986430 authored by Mark Harding's avatar Mark Harding

Revert "[Sprint/HipsterHedgehog](bug) Updated tags pipe to allow . character mid tag #89"

This reverts commit 9aa7e1ff.
parent 82595d15
Pipeline #69268353 passed with stages
in 29 minutes and 57 seconds
......@@ -79,14 +79,6 @@ describe('TagPipe', () => {
expect(transformedString).toContain('<a class="tag"');
});
it('should transform when @ followed by `.com`', () => {
const pipe = new TagsPipe(featuresServiceMock);
const string = 'textstring @name.com';
const transformedString = pipe.transform(<any>string);
expect(transformedString).toContain('<a class="tag"');
expect(transformedString).toContain('@name.com');
});
it('should transform to an email', () => {
const pipe = new TagsPipe(featuresServiceMock);
const string = '[email protected]';
......@@ -98,6 +90,7 @@ describe('TagPipe', () => {
const pipe = new TagsPipe(featuresServiceMock);
const string = 'textstring name';
const transformedString = pipe.transform(<any>string);
expect(transformedString).toEqual(string);
expect(transformedString).not.toContain('<a class="tag"');
});
......
......@@ -39,9 +39,9 @@ export class TagsPipe implements PipeTransform {
}
},
at: {
rule: /(^|\W)@([a-z0-9_\-\.]+[a-z0-9_])(\W|$)/gmi,
rule: /(^|\s|\W)@(\w*[a-zA-Z_-]+\w*)/gim,
replace: (m) => {
return `${m.match[1]}<a class="tag" href="/${m.match[2]}" target="_blank">@${m.match[2]}</a>${m.match[3]}`;
return `${m.match[1]}<a class="tag" href="/${m.match[2]}" target="_blank">@${m.match[2]}</a>`;
}
}
};
......
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