summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pygments/formatters/html.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pygments/formatters/html.py b/pygments/formatters/html.py
index 0b0e5cbe..d1172c7f 100644
--- a/pygments/formatters/html.py
+++ b/pygments/formatters/html.py
@@ -379,14 +379,16 @@ class HtmlFormatter(Formatter):
def _get_css_class(self, ttype):
"""Return the css class of this token type prefixed with
the classprefix option."""
- return self.classprefix + _get_ttype_class(ttype)
+ ttypeclass = _get_ttype_class(ttype)
+ if ttypeclass:
+ return self.classprefix + ttypeclass
+ return ''
def _create_stylesheet(self):
t2c = self.ttype2class = {Token: ''}
c2s = self.class2style = {}
- cp = self.classprefix
for ttype, ndef in self.style:
- name = cp + _get_ttype_class(ttype)
+ name = self._get_css_class(ttype)
style = ''
if ndef['color']:
style += 'color: #%s; ' % ndef['color']