diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2019-02-28 22:05:57 +0100 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2019-02-28 22:05:57 +0100 |
commit | f7e3e003a275add685eb32e2c6aea18e7a322c7f (patch) | |
tree | 8567ff86e7a11917e4cf057a2dd2b9725bdea47d /plugins | |
parent | 470696063d152c742430a28b7d59dc93059bf4df (diff) | |
download | poezio-f7e3e003a275add685eb32e2c6aea18e7a322c7f.tar.gz poezio-f7e3e003a275add685eb32e2c6aea18e7a322c7f.tar.bz2 poezio-f7e3e003a275add685eb32e2c6aea18e7a322c7f.tar.xz poezio-f7e3e003a275add685eb32e2c6aea18e7a322c7f.zip |
code plugin: Add a language class to specify which language this code block is from.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/code.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/code.py b/plugins/code.py index fa04f758..1c6dfab0 100644 --- a/plugins/code.py +++ b/plugins/code.py @@ -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'))) |