Merge pull request #1286 from glowing-bear/revert-1279-entire-words-as-links
Revert "convert entire words as urls or do nothing"
This commit is contained in:
commit
52b1aa0228
|
@ -68,9 +68,7 @@ weechat.filter('conditionalLinkify', ['$filter', function($filter) {
|
|||
return text;
|
||||
}
|
||||
|
||||
|
||||
return text.replaceAll(/\S+/g, function (match, p2) {
|
||||
const result = linkifyStr(match, {
|
||||
return linkifyStr(text, {
|
||||
className: '',
|
||||
attributes: {
|
||||
rel: 'noopener noreferrer'
|
||||
|
@ -84,14 +82,6 @@ weechat.filter('conditionalLinkify', ['$filter', function($filter) {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (result.endsWith("</a>")) {
|
||||
return result;
|
||||
} else {
|
||||
return match
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
}]);
|
||||
|
||||
|
|
|
@ -30,21 +30,6 @@ describe('Filters', function() {
|
|||
result = $filter('conditionalLinkify')(url);
|
||||
expect(result).toEqual(link);
|
||||
}));
|
||||
|
||||
it('convert the entire words to links', angular.mock.inject(function($filter) {
|
||||
var text = 'weechat.network.connection_timeout',
|
||||
link = 'weechat.network.connection_timeout',
|
||||
result = $filter('conditionalLinkify')(text);
|
||||
expect(result).toEqual(link);
|
||||
}));
|
||||
|
||||
it('linkify parenthesis at the end of an url', angular.mock.inject(function($filter) {
|
||||
var text = 'http://test.com/(test)',
|
||||
link = '<a href="http://test.com/(test)" target="_blank" rel="noopener noreferrer">http://test.com/(test)</a>',
|
||||
result = $filter('conditionalLinkify')(text);
|
||||
expect(result).toEqual(link);
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
describe('irclinky', function() {
|
||||
|
|
Loading…
Reference in New Issue