From 7cefaea876da9e25a1c3ea870f4e4b070a196905 Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Tue, 15 Nov 2016 14:08:06 +0000 Subject: explicitly disable eslint inline --- app/assets/javascripts/syntax_highlight.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/assets/javascripts/syntax_highlight.js') diff --git a/app/assets/javascripts/syntax_highlight.js b/app/assets/javascripts/syntax_highlight.js index 77ad4f30b7a..bd37d69165f 100644 --- a/app/assets/javascripts/syntax_highlight.js +++ b/app/assets/javascripts/syntax_highlight.js @@ -1,4 +1,4 @@ -/* eslint-disable */ +/* eslint-disable func-names, space-before-function-paren, consistent-return, no-var, no-undef, no-else-return, prefer-arrow-callback, padded-blocks, max-len */ // Syntax Highlighter // // Applies a syntax highlighting color scheme CSS class to any element with the -- cgit v1.2.1 From 525c2a782e03afafdf9cf1948ab75e73092704fa Mon Sep 17 00:00:00 2001 From: Munken Date: Thu, 8 Dec 2016 22:39:37 +0000 Subject: Math works for inline syntax --- app/assets/javascripts/syntax_highlight.js | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 app/assets/javascripts/syntax_highlight.js (limited to 'app/assets/javascripts/syntax_highlight.js') diff --git a/app/assets/javascripts/syntax_highlight.js b/app/assets/javascripts/syntax_highlight.js deleted file mode 100644 index bd37d69165f..00000000000 --- a/app/assets/javascripts/syntax_highlight.js +++ /dev/null @@ -1,30 +0,0 @@ -/* eslint-disable func-names, space-before-function-paren, consistent-return, no-var, no-undef, no-else-return, prefer-arrow-callback, padded-blocks, max-len */ -// Syntax Highlighter -// -// Applies a syntax highlighting color scheme CSS class to any element with the -// `js-syntax-highlight` class -// -// ### Example Markup -// -//
-// -(function() { - $.fn.syntaxHighlight = function() { - var $children; - if ($(this).hasClass('js-syntax-highlight')) { - // Given the element itself, apply highlighting - return $(this).addClass(gon.user_color_scheme); - } else { - // Given a parent element, recurse to any of its applicable children - $children = $(this).find('.js-syntax-highlight'); - if ($children.length) { - return $children.syntaxHighlight(); - } - } - }; - - $(document).on('ready page:load', function() { - return $('.js-syntax-highlight').syntaxHighlight(); - }); - -}).call(this); -- cgit v1.2.1 From 8e0e902b133f33b38ffaa743ac3f3297b4bceb2d Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Tue, 13 Dec 2016 23:26:26 -0600 Subject: resolve all instances of no-undef eslint rule violations --- app/assets/javascripts/syntax_highlight.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/assets/javascripts/syntax_highlight.js') diff --git a/app/assets/javascripts/syntax_highlight.js b/app/assets/javascripts/syntax_highlight.js index bd37d69165f..fabeb44f4b3 100644 --- a/app/assets/javascripts/syntax_highlight.js +++ b/app/assets/javascripts/syntax_highlight.js @@ -1,4 +1,5 @@ -/* eslint-disable func-names, space-before-function-paren, consistent-return, no-var, no-undef, no-else-return, prefer-arrow-callback, padded-blocks, max-len */ +/* eslint-disable func-names, space-before-function-paren, consistent-return, no-var, no-else-return, prefer-arrow-callback, padded-blocks, max-len */ + // Syntax Highlighter // // Applies a syntax highlighting color scheme CSS class to any element with the -- cgit v1.2.1 From 2d170a20dc4cd3423ac7994c797cae8fbed263ba Mon Sep 17 00:00:00 2001 From: Munken Date: Fri, 9 Dec 2016 00:15:08 +0000 Subject: Render math in Asciidoc and Markdown with KaTeX using code blocks --- app/assets/javascripts/syntax_highlight.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 app/assets/javascripts/syntax_highlight.js (limited to 'app/assets/javascripts/syntax_highlight.js') diff --git a/app/assets/javascripts/syntax_highlight.js b/app/assets/javascripts/syntax_highlight.js new file mode 100644 index 00000000000..f4e9d5af74f --- /dev/null +++ b/app/assets/javascripts/syntax_highlight.js @@ -0,0 +1,28 @@ +/* eslint-disable func-names, space-before-function-paren, consistent-return, no-var, no-undef, no-else-return, prefer-arrow-callback, padded-blocks, max-len */ +// Syntax Highlighter +// +// Applies a syntax highlighting color scheme CSS class to any element with the +// `js-syntax-highlight` class +// +// ### Example Markup +// +//
+// +(function() { + + $.fn.syntaxHighlight = function() { + var $children; + + if ($(this).hasClass('js-syntax-highlight')) { + // Given the element itself, apply highlighting + return $(this).addClass(gon.user_color_scheme); + } else { + // Given a parent element, recurse to any of its applicable children + $children = $(this).find('.js-syntax-highlight'); + if ($children.length) { + return $children.syntaxHighlight(); + } + } + }; + +}).call(this); -- cgit v1.2.1