diff --git a/css/glowingbear.css b/css/glowingbear.css index bee10d0..ca11870 100644 --- a/css/glowingbear.css +++ b/css/glowingbear.css @@ -926,3 +926,9 @@ img.emojione { [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { display: none !important; } + +code { + padding: 0px 2px; + color: #444; + border: 1pt solid #444; +} \ No newline at end of file diff --git a/css/themes/dark.css b/css/themes/dark.css index c03e47a..da260c8 100644 --- a/css/themes/dark.css +++ b/css/themes/dark.css @@ -2114,6 +2114,11 @@ button.close:hover { font-weight: bold; } +code { + background-color: #444; + color: #fff; +} + /* */ /* Mobile layout */ /* */ diff --git a/index.html b/index.html index d76b4b5..94c3d11 100644 --- a/index.html +++ b/index.html @@ -317,7 +317,7 @@ npm run build-electron-{windows, darwin, linux}
' + code + '
' + open + '';
+ return rr;
+ });
+ };
+});
+
})();
diff --git a/package.json b/package.json
index 04feae0..45a2842 100644
--- a/package.json
+++ b/package.json
@@ -7,12 +7,12 @@
"main": "electron-main.js",
"license": "GPLv3",
"devDependencies": {
- "bower": "^1.8",
+ "bower": "^1.8.8",
"electron-packager": "^12.2.0",
"http-server": "^0.11",
"jasmine-core": "^3.1",
"jshint": "^2.9.6",
- "karma": "^3.1.1",
+ "karma": "^4.2.0",
"karma-jasmine": "~1.1",
"karma-junit-reporter": "^1.2",
"karma-phantomjs-launcher": "^1.0.0",
diff --git a/test/unit/filters.js b/test/unit/filters.js
index 2b1358f..ebd6e39 100644
--- a/test/unit/filters.js
+++ b/test/unit/filters.js
@@ -92,4 +92,45 @@ describe('Filters', function() {
// 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 `foo
` z');
+ expect(codifyFilter('z `a` z')).toEqual('z `a
` z');
+ expect(codifyFilter('z ```foo``` z')).toEqual('z ```foo
``` z');
+ }));
+
+ it('should codify multiple snippets', inject(function(codifyFilter) {
+ expect(codifyFilter('z `foo` z `bar` `baz`')).toEqual('z `foo
` z `bar
` `baz
`');
+ }));
+
+ 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');
+ }));
+
+
+ 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`');
+ }));
+
+
+ });
});