Open GoogleCodeExporter opened 9 years ago
I think semantic markup advocates have many good ideas, but it is not a goal of
this
project to promote semanticness or any other markup layout methodology.
While I think avoiding the need for an explicit onload call is good, this
project has
too many clients to change the API that radically now.
Could a wrapper script help make it easier for those who want to use semantic
HTML to
use this code?
Original comment by mikesamuel@gmail.com
on 6 Jan 2009 at 6:34
I understand why you don't want to change the function of the script in order
to keep
backwards compatibility. I would propose making the code more configurable, so
that
the user of the script can decide how they want it to behave.
A few configurable variables could be added to the top of the script, one for
configuring what tags/classes should be prettified, and one that decides how
the
prettify engine should be initialized. The current method of calling
prettyPrint() on
load is noticably "slower" (onload code might be triggered several seconds
later in
the browser than using the method in my aforementioned code to detect DOM
load.) But
since it's, as you say, used in many older clients, it could be kept the
default
behavior.
Original comment by andreasblixt
on 6 Jan 2009 at 8:17
I agree that it is a Good Idea to promote semantic HTML. According to the HTML5
spec, code should have the class ".language-*". I modified prettify to do this
<http://github.com/ariofrio/google-code-prettify>. You can find a thorough
description of the changes in
<http://github.com/ariofrio/google-code-prettify/blob/master/CHANGES.ariofrio>.
I also support the idea to make the script more configurable, allowing it to be
called on DOM load.
Original comment by riofr...@gmail.com
on 1 Nov 2010 at 12:05
Actually, take that code with a grain of salt, since it breaks a few things. I
am currently investigating the source of the misbehaviours.
Original comment by riofr...@gmail.com
on 1 Nov 2010 at 1:49
Are you referring to 4.6.11 (
http://www.w3.org/TR/html5/text-level-semantics.html#the-code-element ) :
Although there is no formal way to indicate the language
of computer code being marked up, authors who wish to
mark code elements with the language used, e.g. so that
syntax highlighting scripts can use the right rules, may do
so by adding a class prefixed with "language-" to the element.
You say "should," whereas that section of HTML5 says "may."
Am I missing a section with stronger language?
Original comment by mikesamuel@gmail.com
on 1 Nov 2010 at 2:55
Of course, when I said should, I meant in my opinion. The point is that it
would be great to be able to configure these things to cater to different
environments, HTML5-following or not.
Original comment by riofr...@gmail.com
on 29 Jan 2011 at 8:46
Original issue reported on code.google.com by
andreasblixt
on 30 May 2008 at 2:09Attachments: