Permalink
Browse files

Downgrading highlight for compatability

  • Loading branch information...
1 parent 5c235b5 commit 96a0ca303361f1d54412ee86fc4a595402f29dd8 @bentruyman committed Feb 3, 2012
Showing with 3 additions and 7 deletions.
  1. +2 −6 app.js
  2. +1 −1 package.json
View
8 app.js
@@ -22,17 +22,13 @@ var tips = require(__dirname + '/tips');
// Make 'em sexy
tips.forEach(function (tip) {
if (tip.example) {
- // Wrap it in script tags to trigger JavaScript highlighting...sigh
- tip.example = hl('<script>\n' + tip.example.join('\n') + '\n</script>');
- // Unwrap (hax)
- tip.example = tip.example.replace('<span class="tag">&lt;<span class="keyword">script</span>&gt;</span><span class="javascript">', '');
- tip.example = tip.example.replace('</span><span class="tag">&lt;/<span class="keyword">script</span>&gt;</span>', '');
+ tip.example = hl(tip.example.join('\n'));
}
});
// Utilities
function showTip (req, res, index) {
- res.render('index.jade', {
+ res.render('index', {
locals: {
tip: tips[index - 1],
color: colors[Math.floor(Math.random() * colors.length)],
View
2 package.json
@@ -12,7 +12,7 @@
},
"dependencies": {
"express": "2.5.6",
- "highlight": "0.2.1",
+ "highlight": "0.1.0",
"jade": "0.20.1",
"socket.io": "0.8.7"
}

0 comments on commit 96a0ca3

Please sign in to comment.