Permalink
Browse files

skip cli blocks

  • Loading branch information...
1 parent 990e03b commit 201d4aebb6833e9c7f9d3fb71ea20523b77549e0 cloudhead committed Jun 12, 2010
Showing with 7 additions and 4 deletions.
  1. +7 −4 hijs.js
View
11 hijs.js
@@ -31,11 +31,14 @@ for (var i = 0, children; i < nodes.length; i++) {
code = children[j];
if (code.length >= 0) { // It's a text node
- Object.keys(syntax).forEach(function (s) {
- code.nodeValue = code.nodeValue.replace(syntax[s], function (_, m) {
- return '{#' + s + '#' + encode(m) + '#}';
+ // Don't highlight command-line snippets
+ if (! /^\$/.test(code.nodeValue.trim())) {
+ Object.keys(syntax).forEach(function (s) {
+ code.nodeValue = code.nodeValue.replace(syntax[s], function (_, m) {
+ return '{#' + s + '#' + encode(m) + '#}';
+ });
});
- });
+ }
}
}
}

0 comments on commit 201d4ae

Please sign in to comment.