Open GoogleCodeExporter opened 8 years ago
Yeah, probably something along these lines would be best:
<pre class="shcode php">Code!</pre>
Original comment by viper007...@gmail.com
on 6 Sep 2007 at 9:50
Instead of use the NAME attribute, invalid for HTML and XHTML strict, to
identify
SyntaxHighlighter tags, plus a class attribute to define its options, I propose
a
new, unified class attribute format to both identify and define syntax
highlighting:
<pre class="... syntax-highlight:language:options ..."> ... </pre>
<textarea class="... syntax-highlight:language:options ..."> ... </textarea>
A working proposal was done (uncompressed JavaScript) at:
http://www.mhavila.com/syntax/js/shCode.js
And a simple test can be view and validate at:
http://www.mhavila.com/syntax_test.html
Attached is the modified version of shCore.js.
Original comment by mhav...@gmail.com
on 21 Oct 2007 at 9:34
Attachments:
The name attribute is perfectly valid in a textarea element, just use that
instead!
Original comment by ccodl...@gmail.com
on 14 Feb 2008 at 7:12
I'd rather propose a convention like this:
<pre class="code">
<code class="html">
<!-- code sample goes here -->
</code>
</pre>
This would create proper namespaces in the HTML/XHTML document straight from
the beginning both for all
possible cases of pre instances and code instances.
( Makes at also easier to handle Users, who have Javascript switched off)
Original comment by sundrive...@gmail.com
on 25 Feb 2008 at 1:47
Regarding the name attribute:
What I now did, to have a valid XHTML document is just replace the name
attribute with a title attribute
(Which is valid)
As a workaround, so to speak.
Original comment by sundrive...@gmail.com
on 25 Feb 2008 at 1:49
I think that semantically, sundrivedesign's first proposal is probably the best,
especially for users without JavaScript and/or screen readers. IMO textarea is a
hack, and doesn't the title attribute get read out by screen readers, which may
not
be what you want?
Original comment by jammyca...@gmail.com
on 22 May 2008 at 2:04
I think syntaxhighlighter must use the language-* value for the class attribute
like
this :
<pre><code class="language-javascript"></code></pre>
The class="language-LANGNAME" attribute is a part of (the draft of) the HTML5
specification and is compatible with backward compatible with the currents
versions
of HTML and XHTML.
Please make syntaxhighlighter as standard compliant as possible :)
See http://code.google.com/p/syntaxhighlighter/issues/detail?id=91 to know why
use
<code> instead of <pre>.
Original comment by dung...@gmail.com
on 23 Jul 2008 at 10:31
dunglas: That's good to know. Can you point at the HTML5 draft section about
this?
Original comment by docw...@gmail.com
on 24 Jul 2008 at 3:25
Would be better to use the 'id' attribute and to change line 618 in shCore.js
to
if(tags[i].getAttribute('id') == name)
Original comment by kalek...@googlemail.com
on 23 Nov 2008 at 1:07
Original issue reported on code.google.com by
dr0iddr0id@gmail.com
on 15 Aug 2007 at 7:04