Commit f7e3e003 authored by Link Mauve's avatar Link Mauve
Browse files

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

parent 47069606
......@@ -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