summaryrefslogtreecommitdiff
path: root/plugins/code.py
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/code.py')
-rw-r--r--plugins/code.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/code.py b/plugins/code.py
index 028f0f70..ef4cbb70 100644
--- a/plugins/code.py
+++ b/plugins/code.py
@@ -28,7 +28,7 @@ from plugin import BasePlugin
from pygments import highlight
from pygments.lexers import get_lexer_by_name
from pygments.formatters import HtmlFormatter
-FORMATTER = HtmlFormatter(noclasses=True)
+FORMATTER = HtmlFormatter(nowrap=True, noclasses=True)
class Plugin(BasePlugin):
def init(self):
@@ -41,4 +41,5 @@ class Plugin(BasePlugin):
language, code = args.split(None, 1)
lexer = get_lexer_by_name(language)
room = self.api.current_tab()
- room.command_xhtml(highlight(code, lexer, FORMATTER).strip().replace('\n</pre>', '</pre>'))
+ code = highlight(code, lexer, FORMATTER)
+ room.command_xhtml('<pre>%s</pre>' % code.rstrip('\n'))