3 pygments.formatters.html |
3 pygments.formatters.html |
4 ~~~~~~~~~~~~~~~~~~~~~~~~ |
4 ~~~~~~~~~~~~~~~~~~~~~~~~ |
5 |
5 |
6 Formatter for HTML output. |
6 Formatter for HTML output. |
7 |
7 |
8 :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. |
8 :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. |
9 :license: BSD, see LICENSE for details. |
9 :license: BSD, see LICENSE for details. |
10 """ |
10 """ |
11 |
11 |
12 import os |
12 import os |
13 import sys |
13 import sys |
594 mw, (num%st and ' ' or num)) + line |
594 mw, (num%st and ' ' or num)) + line |
595 num += 1 |
595 num += 1 |
596 |
596 |
597 def _wrap_lineanchors(self, inner): |
597 def _wrap_lineanchors(self, inner): |
598 s = self.lineanchors |
598 s = self.lineanchors |
599 i = 0 |
599 i = self.linenostart - 1 # subtract 1 since we have to increment i *before* yielding |
600 for t, line in inner: |
600 for t, line in inner: |
601 if t: |
601 if t: |
602 i += 1 |
602 i += 1 |
603 yield 1, '<a name="%s-%d"></a>' % (s, i) + line |
603 yield 1, '<a name="%s-%d"></a>' % (s, i) + line |
604 else: |
604 else: |