Commit f7e3e003 authored by Link Mauve's avatar Link Mauve

code plugin: Add a language class to specify which language this code block is from.

parent 47069606
Pipeline #1964 passed with stages
in 2 minutes and 22 seconds
......@@ -43,6 +43,6 @@ class Plugin(BasePlugin):
def command_code(self, args):
language, code = args.split(None, 1)
lexer = get_lexer_by_name(language)
room = self.api.current_tab()
tab = self.api.current_tab()
code = highlight(code, lexer, FORMATTER)
room.command_xhtml('<pre>%s</pre>' % code.rstrip('\n'))
tab.command_xhtml('<pre><code class="language-%s">%s</code></pre>' % (language, code.rstrip('\n')))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment