W3C home > Mailing lists > Public > spec-prod@w3.org > January to March 2014

Re: syntax highlighting

From: James Craig <jcraig@apple.com>
Date: Thu, 27 Mar 2014 01:34:28 -0700
Cc: "spec-prod@w3.org Prod" <spec-prod@w3.org>
Message-id: <7DA8BA62-392D-42A1-92FD-6A83894ECE82@apple.com>
To: Shane McCarron <shane@aptest.com>
I just tried this out and it looks great for markup and JavaScript examples, but leaves something to be desired for CSS. 

For example, The "checked" substring of the [aria-checked] attribute selector gets flagged as a keyword. Likewise for the filename substring.
[aria-checked="true"]::before { background-image: url(checked.gif); }
Quoting from http://www.w3.org/respec/ref.html#highlight
"The syntax highlighter will do its best to guess how to perform highlighting without knowing the language. If needed you can tweak the syntax highlighting styles in order to obtain better results."

Is this suggesting color tweaking or something more substantive. If I add a data-transform attr to a node like <pre class="example highlight">, does that transformation happen before or after the highlighting step? I'm wondering if I should special-case the CSS examples and retransform them after the highlight, or remove the highlight class on these.


Received on Thursday, 27 March 2014 08:34:57 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:55:19 UTC