code plugin: Add a language class to specify which language this code block is from.
This commit is contained in:
parent
470696063d
commit
f7e3e003a2
1 changed files with 2 additions and 2 deletions
|
@ -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')))
|
||||
|
|
Loading…
Reference in a new issue