Comments (6)
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 [email protected]
on 6 Jan 2009 at 6:34
from google-code-prettify.
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
from google-code-prettify.
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 [email protected]
on 1 Nov 2010 at 12:05
from google-code-prettify.
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 [email protected]
on 1 Nov 2010 at 1:49
from google-code-prettify.
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 [email protected]
on 1 Nov 2010 at 2:55
from google-code-prettify.
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 [email protected]
on 29 Jan 2011 at 8:46
from google-code-prettify.
Related Issues (20)
- Perl syntax highlighting does not recognize POD and highlights quotes in comments
- Bash "$#" treated as comment HOT 1
- Integration for Presentation
- Patch for /trunk/src/lang-css.js
- "><img src=x onerror=prompt(1);> HOT 2
- Feature request: AspectJ syntax highlighting.
- gzip disabled
- Patch for /trunk/js-modules/run_prettify.js
- Patch for /trunk/src/lang-vb.js
- Line numbers carry over in clipboard using IE 11.
- Patch for /trunk/src/awkirin.css
- Problem with backslash in VB
- FLOW_CONTROL_KEYWORDS should not contain `do`
- Syntax Highlighting for Rebol (and Red) programming languages
- Patch for /trunk/styles/sons-of-obsidian.css
- Syntax highlight for Robot Framework syntax
- Patch for /trunk/src/prettify.css HOT 1
- Inconsist TCL Syntax higlighter
- Patch for /trunk/src/lang-sql.js
- Patch for /trunk/styles/sons-of-obsidian.css
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-code-prettify.