diff options
author | gbrandl <devnull@localhost> | 2008-12-29 23:05:24 +0100 |
---|---|---|
committer | gbrandl <devnull@localhost> | 2008-12-29 23:05:24 +0100 |
commit | dfc4b4ba287b141e82832655ba312c02c184135c (patch) | |
tree | ad579fc6724002519bc1b749375820d02b6793bf | |
parent | d8058c18b5e489bcf6c992987d4ff11ef1d8b8a5 (diff) | |
download | pygments-dfc4b4ba287b141e82832655ba312c02c184135c.tar.gz |
Put linenos in the table option in their own <div> to avoid layout issues.
-rw-r--r-- | pygments/formatters/html.py | 7 |
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>' |