view_source: Add line numbers.

This commit is contained in:
Florian Bruhin 2014-09-15 18:19:56 +02:00
parent 175d25b3c4
commit 19afa69d87

View File

@ -760,7 +760,8 @@ class CommandDispatcher:
url = self._tabs.current_url()
html = frame.toHtml()
lexer = pygments.lexers.HtmlLexer()
formatter = pygments.formatters.HtmlFormatter(full=True)
formatter = pygments.formatters.HtmlFormatter(
full=True, linenos='table')
highlighted = pygments.highlight(html, lexer, formatter)
tab = self._tabs.tabopen(explicit=True)
tab.setHtml(highlighted, url)