cssclass for htmlformatter in pygments

Issue #204 resolved
Former user created an issue

In: pygments.formatters.html

the 'cssclass' option is passed to the containing div, but when calling get_style_defs it still uses the default 'highlight' class.

Reported by guest

Comments (5)

  1. gbrandl

    Where exactly do you see this behavior? get_style_defs() itself does not use any class unless you give it an argument -- this should be the same as self.cssclass of course.

  2. Anonymous

    Sorry, this was about the used css className in the HTML output, not about a Python class.

    <div class="highlight"> ... </div>

  3. Anonymous

    Euhm, sorry. I was wrong. I think you can close this ticket.

    After calling:

    formatter = pygments.formatters.HtmlFormatter (cssclass='myclass')

    I did something like in another file:

    formatter.get_style_defs('.highlight')

    The get_style_defs doesn't use the cssclass that has been passed earlier to the formatter. Mybe it's better if that was the default behaviour.

    I don't know...

  4. Log in to comment