Skip to content

Commit

Permalink
fix(action): bug fix in linkify pipe (DSP-1837) (#325)
Browse files Browse the repository at this point in the history
* fix(action): bug fix in linkify pipe (DSP-1836)

* test(action): more tests on linkify pipe
  • Loading branch information
kilchenmann committed Aug 3, 2021
1 parent c5fd660 commit 13fb692
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -29,4 +29,10 @@ describe('LinkifyPipe', () => {
const linkifiedSnippet = pipe.transform(text);
expect(linkifiedSnippet).toEqual('You can visit the app on <a href="https://app.dasch.swiss" target="_blank">https://app.dasch.swiss</a> and the documentation on <a href="http://docs.dasch.swiss" target="_blank">docs.dasch.swiss</a>.');
});

it('should keep the spaces after a full stop or after a comma', () => {
const text = 'This is just a title. And it could have an URL, but it doesn\'t have one. ';
const linkifiedSnippet = pipe.transform(text);
expect(linkifiedSnippet).toEqual('This is just a title. And it could have an URL, but it doesn\'t have one.');
});
});
Expand Up @@ -19,7 +19,7 @@ export class LinkifyPipe implements PipeTransform {
let end = ' ';
if (endsWithFullStop) {
str = str.slice(0, -1);
end = '.'
end = lastChar + ' ';
}
if (this._recognizeUrl(str)) {
const url = this._setProtocol(str);
Expand Down

0 comments on commit 13fb692

Please sign in to comment.