Syntax Highlighter

By Joel H Last update Mar 22, 2007 — Installed 710 times. Daily Installs: 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 3, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 4, 0, 1, 0, 1, 1

Archived Comments (locked)

Subscribe to Archived Comments 9 posts, 7 voices

Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

 
Joel H Script's Author

That's what I get for using a "code" tag in text...

On that note, it should be possible to edit posts here, but I don't see how.

What I meant to say is:

I have a question for the user base: under what conditions should the code be highlighted? "code" tags and the "pre" setup used by us.o forums are obvious answers, but what other conditions should trigger it? I've been thinking that it should be possible to require a certain number of syntax matches per number of characters in the tags, but that might not work in all cases. I'm open to suggestions on how to approach this problem.

-Joel

 
Joel H Script's Author

I've been working on incorporating the google script into this one; it's a bit of a project, so I'll have to try to take time this weekend to work on it.

I have a question for the user base: under what conditions should the code be highlighted? tags and the

 setup used by us.o forums are obvious answers, but what other conditions should trigger it? I've been thinking that it should be possible to require a certain number of syntax matches per number of characters in the tags, but that might not work in all cases. I'm open to suggestions on how to approach this problem.

-Joel

 
masterfuol Scriptwright

@Junk Blocker

gm wrapper for google-code-prettify, supports js/css as per the google-code script:

http://userscripts.org/scripts/show/8065

@Adrian

I tried adapting my google-code-prettify wrapper for *.js files but ran into a brickwall due to the mimetype being text/plain or text/javascript meaning that firefox doesnt render them as html. Couldnt find any way around this except for making and extension or hacking greasemonkey.

 
Junk Blocker Scriptwright

Just saw this

http://code.google.com/p/google-code-prettify/

which might be relevant.

 
Alan K Scriptwright

very nice, you did what i didnt hav time to do. but it still doesnt work...

 
Adrian Scriptwright

Nice idea. But it would be great if it worked on *.js files, and http://userscripts.org/scripts/source/*

 
Henrik N Admin

Oops, sorry about that. That was test text intended for a local instance of this site. :D

 
Henrik N Admin

apa
skapa

lapa

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel