Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(action): bug fix in linkify pipe (DSP-1837) #325

Merged
merged 2 commits into from Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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