XHTML compliance

1 view
Skip to first unread message


Jul 31, 2007, 2:29:12 AM7/31/07
to syntaxhighlighter

I've been using server side syntax highlighter solutions and wanted a
js one. I discovered this amazing piece of software and I think it is

Sorry if this is alredy discussed...

IMHO, the lack of xhtml support (<pre> doesn't have an attribute
'name' in XHTML, so it is not valid) is a great disadvantage as it is
necessary for the project to succeed.

I think it would be better to look for code inside code tags
(<pre><code> var a; </code></pre>) rather than simple pre tags for the
sake of semantics, or giving the user the option to look for code
within any element, searching by class name (e.g. <div class="code

Changes in the code would be minimal. It took me 5 minutes to get the
uncompressed js file changed so that it works like this:

window.onload = function(){
dp.SyntaxHighlighter.ClipboardSwf = '/swf/clipboard.swf';
/* 'code' being the class of the <code> elements I want to
highlight */

In the xhtml, the code element has 2 classes, the first indicates that
the element must be highlighted, and the second indicates the

<code class="code js">

var foo = function(){ return 'bas'; };


By the way, it would be cool to automatically include the language
files as needed instead of including them manually.

Congratulations again for the great job.

Best Regards,


Reply all
Reply to author
0 new messages