summaryrefslogtreecommitdiff
path: root/pygments/formatters/html.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/formatters/html.py')
-rw-r--r--pygments/formatters/html.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pygments/formatters/html.py b/pygments/formatters/html.py
index 3029c1cc..f9588f78 100644
--- a/pygments/formatters/html.py
+++ b/pygments/formatters/html.py
@@ -765,7 +765,8 @@ class HtmlFormatter(Formatter):
for t, line in inner:
if t:
i += 1
- yield 1, '<a id="%s-%d" name="%s-%d"></a>' % (s, i, s, i) + line
+ href = "" if self.linenos else ' href="%s-%d"' % (s, i)
+ yield 1, '<a id="%s-%d" name="%s-%d"%s></a>' % (s, i, s, i, href) + line
else:
yield 0, line