|
|
|
@ -100,6 +100,8 @@ describe('Filters', function() { |
|
|
|
|
|
|
|
|
|
it('should codify single snippets', inject(function(codifyFilter) { |
|
|
|
|
expect(codifyFilter('z `foo` z')).toEqual('z <span class="hidden-bracket">`</span><code>foo</code><span class="hidden-bracket">`</span> z'); |
|
|
|
|
expect(codifyFilter('z `a` z')).toEqual('z <span class="hidden-bracket">`</span><code>a</code><span class="hidden-bracket">`</span> z'); |
|
|
|
|
expect(codifyFilter('z ```foo``` z')).toEqual('z <span class="hidden-bracket">```</span><code>foo</code><span class="hidden-bracket">```</span> z'); |
|
|
|
|
})); |
|
|
|
|
|
|
|
|
|
it('should codify multiple snippets', inject(function(codifyFilter) { |
|
|
|
@ -115,5 +117,20 @@ describe('Filters', function() { |
|
|
|
|
})); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it('should not codify double backticks', inject(function(codifyFilter) { |
|
|
|
|
expect(codifyFilter('some ``non-code``')).toEqual('some ``non-code``'); |
|
|
|
|
})); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it('should not codify pseudo-fancy quotes', inject(function(codifyFilter) { |
|
|
|
|
expect(codifyFilter('some ``fancy qoutes\'\'')).toEqual('some ``fancy qoutes\'\''); |
|
|
|
|
})); |
|
|
|
|
|
|
|
|
|
it('should not codify stuff in the middle of a word or URL', inject(function(codifyFilter) { |
|
|
|
|
expect(codifyFilter('https://foo.bar/`wat`')).toEqual('https://foo.bar/`wat`'); |
|
|
|
|
expect(codifyFilter('Weird`ness`')).toEqual('Weird`ness`'); |
|
|
|
|
})); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|