Demo site always uses "friendly" style as fallback

Issue #1431 new
Jesse Tan
created an issue

The Pygments online demo at http://pygments.org/demo/ serves a CSS file that contains rules for the friendly style with selector prefix pre, as well as the selected style with selector prefix .syntax pre.

If the selected style does not contain some style rule (e.g. Monokai does not define a color for Generic prompt (class .gp)), the rule from friendly is used instead.

Responsible code

https://bitbucket.org/birkenfeld/pygments-website/src/200b7e1cce4878fee6df62d8583fc6f0a5cd9c49/pygmentswww/demo/views.py?at=default&fileviewer=file-view-default#views.py-290

Reproduction

  1. Enter the following code in the online demo: $ echo "hello"
  2. Set language to Bash session
  3. When viewing the highlighted code, select the monokai style
  4. The prompt $ is colored because it matches .pre .gp defined by the friendly style

Expected

The prompt $ is not colored because the requested style it did not define a color.

Comments (0)

  1. Log in to comment