Commits

Jesper Nøhr  committed 5e8d6e4

wrapping at EOL80

  • Participants
  • Parent commits 023f905

Comments (0)

Files changed (1)

File anchor-linenos.patch

 diff -r c20574958ca5 pygments/formatters/html.py
 --- a/pygments/formatters/html.py	Sun Feb 08 23:33:48 2009 +0100
-+++ b/pygments/formatters/html.py	Tue Feb 10 13:05:47 2009 +0100
++++ b/pygments/formatters/html.py	Tue Feb 10 13:33:57 2009 +0100
 @@ -274,6 +274,10 @@
          output line in an anchor tag with a ``name`` of ``foo-linenumber``.
          This allows easy linking to certain lines. *New in Pygments 0.9.*
          self.hl_lines = set()
          for lineno in get_list_opt(options, 'hl_lines', []):
              try:
-@@ -490,16 +495,41 @@
+@@ -490,16 +495,45 @@
          mw = len(str(lncount + fl - 1))
          sp = self.linenospecial
          st = self.linenostep
 +                if i % st == 0:
 +                    if i % sp == 0:
 +                        if aln:
-+                            lines.append('<a href="#%s-%d" class="special">%*d</a>' % (la, i, mw, i))
++                            lines.append('<a href="#%s-%d"' + \
++                                ' class="special">%*d</a>' % (la, i, mw, i))
 +                        else:                            
-+                            lines.append('<span class="special">%*d</span>' % (mw, i))
++                            lines.append('<span class="special">%*d</span>' \
++                                            % (mw, i))
 +                    else:
 +                        if aln:
-+                            lines.append('<a href="#%s-%d">%*d</a>' % (la, i, mw, i))
++                            lines.append('<a href="#%s-%d">%*d</a>' \
++                                            % (la, i, mw, i))
 +                        else:
 +                            lines.append('%*d' % (mw, i))
 +                else:
 +            for i in range(fl, fl+lncount):
 +                if i % st == 0:
 +                    if aln:
-+                        lines.append('<a href="#%s-%d">%*d</a>' % (la, i, mw, i))
++                        lines.append('<a href="#%s-%d">%*d</a>' \
++                                        % (la, i, mw, i))
 +                    else:
 +                        lines.append('%*d' % (mw, i))
 +                else: