summaryrefslogtreecommitdiff
path: root/pygments/formatters/html.py
diff options
context:
space:
mode:
authorgbrandl <devnull@localhost>2008-12-29 23:05:24 +0100
committergbrandl <devnull@localhost>2008-12-29 23:05:24 +0100
commitdfc4b4ba287b141e82832655ba312c02c184135c (patch)
treead579fc6724002519bc1b749375820d02b6793bf /pygments/formatters/html.py
parentd8058c18b5e489bcf6c992987d4ff11ef1d8b8a5 (diff)
downloadpygments-dfc4b4ba287b141e82832655ba312c02c184135c.tar.gz
Put linenos in the table option in their own <div> to avoid layout issues.
Diffstat (limited to 'pygments/formatters/html.py')
-rw-r--r--pygments/formatters/html.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pygments/formatters/html.py b/pygments/formatters/html.py
index be4c91bd..f7834099 100644
--- a/pygments/formatters/html.py
+++ b/pygments/formatters/html.py
@@ -500,9 +500,12 @@ class HtmlFormatter(Formatter):
ls = '\n'.join([(i%st == 0 and ('%*d' % (mw, i)) or '')
for i in range(fl, fl + lncount)])
+ # in case you wonder about the seemingly redundant <div> here: since the
+ # content in the other cell also is wrapped in a div, some browsers in
+ # some configurations seem to mess up the formatting...
yield 0, ('<table class="%stable">' % self.cssclass +
- '<tr><td class="linenos"><pre>' +
- ls + '</pre></td><td class="code">')
+ '<tr><td class="linenos"><div class="linenodiv"><pre>' +
+ ls + '</pre></div></td><td class="code">')
yield 0, dummyoutfile.getvalue()
yield 0, '</td></tr></table>'