Merge pull request #1045 from rscullin/dont-linkify-joinparts
Don't linkify hostnames in join/part messages.
This commit is contained in:
commit
7989cbfa46
@ -336,7 +336,7 @@ npm run build-electron-{windows, darwin, linux}</pre>
|
|||||||
<td class="prefix"><span ng-class="::{'repeated-prefix': bufferline.prefixtext==bufferlines[$index-1].prefixtext}"><a ng-click="addMention(bufferline)"><span class="hidden-bracket" ng-if="::(bufferline.showHiddenBrackets)"><</span><span ng-repeat="part in ::bufferline.prefix" ng-class="::part.classes" ng-bind="::part.text|prefixlimit:25"></span><span class="hidden-bracket" ng-if="::(bufferline.showHiddenBrackets)">></span></a></span></td><!--
|
<td class="prefix"><span ng-class="::{'repeated-prefix': bufferline.prefixtext==bufferlines[$index-1].prefixtext}"><a ng-click="addMention(bufferline)"><span class="hidden-bracket" ng-if="::(bufferline.showHiddenBrackets)"><</span><span ng-repeat="part in ::bufferline.prefix" ng-class="::part.classes" ng-bind="::part.text|prefixlimit:25"></span><span class="hidden-bracket" ng-if="::(bufferline.showHiddenBrackets)">></span></a></span></td><!--
|
||||||
--><td class="message"><!--
|
--><td class="message"><!--
|
||||||
--><div ng-repeat="metadata in ::bufferline.metadata" plugin data="::metadata"></div><!--
|
--><div ng-repeat="metadata in ::bufferline.metadata" plugin data="::metadata"></div><!--
|
||||||
--><span ng-repeat="part in ::bufferline.content" class="text" ng-class="::part.classes.concat(['line-' + part.$$hashKey.replace(':','_')])" ng-bind-html="::part.text | linky:'_blank':{rel:'noopener noreferrer'} | DOMfilter:'irclinky' | DOMfilter:'emojify':settings.enableJSEmoji | DOMfilter:'inlinecolour' | DOMfilter:'latexmath':('.line-' + part.$$hashKey.replace(':','_')):settings.enableMathjax"></span>
|
--><span ng-repeat="part in ::bufferline.content" class="text" ng-class="::part.classes.concat(['line-' + part.$$hashKey.replace(':','_')])" ng-bind-html="::part.text | conditionalLinkify:part.classes.includes('cof-chat_host') | DOMfilter:'irclinky' | DOMfilter:'emojify':settings.enableJSEmoji | DOMfilter:'inlinecolour' | DOMfilter:'latexmath':('.line-' + part.$$hashKey.replace(':','_')):settings.enableMathjax"></span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="readmarker" ng-if="activeBuffer().lastSeen==$index">
|
<tr class="readmarker" ng-if="activeBuffer().lastSeen==$index">
|
||||||
|
@ -59,6 +59,17 @@ weechat.filter('inlinecolour', function() {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Calls the 'linky' filter unless the disable flag is set. Useful for things like join/quit messages,
|
||||||
|
// so you don't accidentally click a mailto: on someone's hostmask.
|
||||||
|
weechat.filter('conditionalLinkify', ['$filter', function($filter) {
|
||||||
|
return function(text, disable) {
|
||||||
|
if (!text || disable) {
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
return $filter('linky')(text, '_blank', {rel:'noopener noreferrer'});
|
||||||
|
};
|
||||||
|
}]);
|
||||||
|
|
||||||
// apply a filter to an HTML string's text nodes, and do so with not exceedingly terrible performance
|
// apply a filter to an HTML string's text nodes, and do so with not exceedingly terrible performance
|
||||||
weechat.filter('DOMfilter', ['$filter', '$sce', function($filter, $sce) {
|
weechat.filter('DOMfilter', ['$filter', '$sce', function($filter, $sce) {
|
||||||
// To prevent nested anchors, we need to know if a filter is going to create them.
|
// To prevent nested anchors, we need to know if a filter is going to create them.
|
||||||
|
Loading…
Reference in New Issue
Block a user