Export to GitHub

syntaxhighlighter - issue #91

[PATCH] Use <code> instead of <pre>


Posted on Jul 23, 2008 by Happy Ox

According to the W3C spec and http://dev.opera.com/articles/view/21-lesser-known-semantic-elements/ source code must be into <code> and </code> tags.

i.e <pre><code>public void function rocknroll() { System.out.println("The Clash"); }</code></pre>

It's impossible to that in the current version of syntaxhighlighter because the <code> tag is displayed (escaped).

Note that <code> is more semantical than a simple <pre> tag and describe the type of data.

The patch is very easy: edit shCore.js and change FindTagsByName(_75,_5f,"pre"); by FindTagsByName(_75,_5f,"code"); on line 373.

Status: New

Labels:
Type-Defect Priority-Medium