summaryrefslogtreecommitdiff
path: root/lib/rouge
diff options
context:
space:
mode:
authorHoracio Sanson <horacio@allm.net>2017-01-16 09:07:02 +0900
committerHoracio Sanson <horacio@allm.net>2017-02-03 08:49:48 +0900
commitd9e9ad2211c06159914e0183e4842abc16e5666f (patch)
treeffa7e02948f10a42b42d33d3b568774c147bd98c /lib/rouge
parente7d530a624fbb8854047c3983eaa0972a19f36c8 (diff)
downloadgitlab-ce-d9e9ad2211c06159914e0183e4842abc16e5666f.tar.gz
PlantUML support for Markdown
Allow rendering of PlantUML diagrams in Markdown documents using fenced blocks: ```plantuml Bob -> Sara : Hello Sara -> Bob : Go away ``` Closes: #4048
Diffstat (limited to 'lib/rouge')
-rw-r--r--lib/rouge/lexers/plantuml.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/rouge/lexers/plantuml.rb b/lib/rouge/lexers/plantuml.rb
new file mode 100644
index 00000000000..7d5700b7f6d
--- /dev/null
+++ b/lib/rouge/lexers/plantuml.rb
@@ -0,0 +1,21 @@
+module Rouge
+ module Lexers
+ class Plantuml < Lexer
+ title "A passthrough lexer used for PlantUML input"
+ desc "A boring lexer that doesn't highlight anything"
+
+ tag 'plantuml'
+ 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