summaryrefslogtreecommitdiff
path: root/lib/rouge/lexers/math.rb
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-12-16 18:03:24 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-12-16 18:03:24 -0200
commit785459d1617887ad8c3cd530c6cd79c33336fc41 (patch)
treeeaea702b7a427d14f4ffd689da23c6472e4f9b58 /lib/rouge/lexers/math.rb
parentdbe2ac8ccc07f53669214eb954489a6cb233d4e9 (diff)
parentb3d5ed62de3519b42dbcef2973c189467588fc36 (diff)
downloadgitlab-ce-785459d1617887ad8c3cd530c6cd79c33336fc41.tar.gz
Merge remote-tracking branch 'origin/master' into bitbucket-oauth2
Diffstat (limited to 'lib/rouge/lexers/math.rb')
-rw-r--r--lib/rouge/lexers/math.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/rouge/lexers/math.rb b/lib/rouge/lexers/math.rb
new file mode 100644
index 00000000000..80784adfd76
--- /dev/null
+++ b/lib/rouge/lexers/math.rb
@@ -0,0 +1,21 @@
+module Rouge
+ module Lexers
+ class Math < Lexer
+ title "A passthrough lexer used for LaTeX input"
+ desc "A boring lexer that doesn't highlight anything"
+
+ tag 'math'
+ mimetypes 'text/plain'
+
+ default_options token: 'Text'
+
+ def token
+ @token ||= Token[option :token]
+ end
+
+ def stream_tokens(string, &b)
+ yield self.token, string
+ end
+ end
+ end
+end