From 8a62ae7ad844930bcdcbcadbfede83bbdbb59ccd Mon Sep 17 00:00:00 2001
From: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Date: Fri, 24 Feb 2017 17:35:08 +0000
Subject: Make the code plugin stop using extra attributes and div.

---
 plugins/code.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'plugins')

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'))
-- 
cgit v1.2.3