summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2017-02-24 17:35:08 +0000
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2017-02-24 17:36:17 +0000
commit8a62ae7ad844930bcdcbcadbfede83bbdbb59ccd (patch)
tree0b8aee78aa286390cc706e50af8a7ce59c3ed569 /plugins
parent38ba85985441f9a1ddb3ed6b2e9749f1ff92080d (diff)
downloadpoezio-8a62ae7ad844930bcdcbcadbfede83bbdbb59ccd.tar.gz
poezio-8a62ae7ad844930bcdcbcadbfede83bbdbb59ccd.tar.bz2
poezio-8a62ae7ad844930bcdcbcadbfede83bbdbb59ccd.tar.xz
poezio-8a62ae7ad844930bcdcbcadbfede83bbdbb59ccd.zip
Make the code plugin stop using extra attributes and div.
Diffstat (limited to 'plugins')
-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'))