Invalid CSS with Ruby Syntax Highlighter
I regularly use Carl Drinkwater’s Ruby Syntax Highlighter for my postings containing Ruby code. When I was checking my site for valid XHTML and CSS I noticed that I had a few problems coming from the generated HTML and the CSS snippet he provides.
I’ve emailed Carl to let him know, but in the meantime, if you use his syntax highlighter you should change the CSS provided to be:
<style>
.keyword { font-family: monospace; color: #8B0000; }
.constant, .attribute, .global, .class, .module {
font-family: monospace; color: black;
}
.string { font-family: monospace; color: #00008B; }
.ident, .method { font-family: monospace; color: #006400; }
.number, .char { font-family: monospace; color: #888800; }
.comment { font-family: monospace; color: purple; }
.symbol { font-family: monospace; color: #884400; }
.regex { font-family: monospace; color: #808080; }
.punct { font-family: monospace; color: black; }
.escape, .interp, .expr {
font-family: monospace; color: black; background-color: #dddddd;
}
</style>
The original CSS he provides uses named colors which are not standard.
I also noticed some invalid XHTML being produced but now that I go back and check his site, it seems to be working fine. It might just have been my desktop blogging software or Typo (I’d bet the blog software over this) that re-interpreted the HTML and mangled it to be invalid.
Just for reference, the problems I was seeing were end span tags in all caps, and class attribute values being unquoted on some span tags.
About this entry
You’re currently reading “Invalid CSS with Ruby Syntax Highlighter,” an entry on Late to the Party by cwilliams
- Published:
- 6pm on 07/13/05
- Categories:
- Ruby, Web design
No Comments
Jump to comment form | comments rss | trackback uri