1. Georg Brandl
  2. pygments-main
  3. Issues
Issue #694 resolved

CSS: pygments does not allow underlines in counter identifiers

created an issue

== Input ==

Using a minimal working example:



body { counter-reset: first_header; } }}}

== Output==

This input leads to the following HTML output in pygmentize



<span class="nt">body</span> <span class="p">{</span> <span class="k">counter-reset</span><span class="o">:</span> <span class="n">first</span><span class="err">_</span><span class="n">header</span><span class="p">;</span> <span class="p">}</span> }}}

Please recognize the section



<span class="n">first</span><span class="err">_</span><span class="n">header</span> }}}

... which breaks up the counter identifier "first_header" into three parts with an underline error class in the middle.

== Expected Output ==



<span class="n">first_header</span> }}}

== Notes ==

However, this is allowed according to W3C:

http://www.w3.org/TR/CSS2/generate.html#counters http://www.w3.org/TR/CSS2/syndata.html#value-def-identifier

In CSS, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [a-zA-Z0-9] and ISO 10646 characters U+00A0 and higher, plus the hyphen (-) and the underscore (_)

Tested with: Pygments version 1.4

Comments (2)

  1. Log in to comment