commit
521f75c238
@ -926,3 +926,7 @@ img.emojione {
|
|||||||
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
|
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
padding: 0px 2px;
|
||||||
|
}
|
@ -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 | conditionalLinkify:part.classes.includes('cof-chat_host') | 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') | codify | 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">
|
||||||
|
@ -237,4 +237,14 @@ weechat.filter('prefixlimit', function() {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
weechat.filter('codify', function() {
|
||||||
|
return function(text) {
|
||||||
|
var re = /(`.+?`)/g;
|
||||||
|
return text.replace(re, function(z) {
|
||||||
|
var rr = '<code>' + z.slice(1, z.length-1) + '</code>';
|
||||||
|
return rr;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
@ -92,4 +92,28 @@ describe('Filters', function() {
|
|||||||
// I.e. if we ever got this far, the bug is fixed.
|
// I.e. if we ever got this far, the bug is fixed.
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('codify', function() {
|
||||||
|
it('should not mess up text', inject(function(codifyFilter) {
|
||||||
|
expect(codifyFilter('foo')).toEqual('foo');
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should codify single snippets', inject(function(codifyFilter) {
|
||||||
|
expect(codifyFilter('z `foo` z')).toEqual('z <code>foo</code> z');
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should codify multiple snippets', inject(function(codifyFilter) {
|
||||||
|
expect(codifyFilter('z `foo` z `bar` `baz`')).toEqual('z <code>foo</code> z <code>bar</code> <code>baz</code>');
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should not codify empty snippets', inject(function(codifyFilter) {
|
||||||
|
expect(codifyFilter('``')).toEqual('``');
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should not codify single backticks', inject(function(codifyFilter) {
|
||||||
|
expect(codifyFilter('foo`bar')).toEqual('foo`bar');
|
||||||
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user