Skip to content
Browse files

highlight code

  • Loading branch information...
1 parent 190bfbc commit e294b1e4b2689d7920301bd096e20cfaa6701b12 @tj tj committed
Showing with 12 additions and 5 deletions.
  1. +12 −5 support/tail.js
View
17 support/tail.js
@@ -88,6 +88,17 @@ window.mocha = require('mocha');
}
/**
+ * Highlight code contents.
+ */
+
+ function highlightCode() {
+ var code = document.getElementsByTagName('code');
+ for (var i = 0, len = code.length; i < len; ++i) {
+ code[i].innerHTML = highlight(code[i].innerHTML);
+ }
+ }
+
+ /**
* Parse the given `qs`.
*/
@@ -124,11 +135,7 @@ window.mocha = require('mocha');
var reporter = new Reporter(runner);
var query = parse(window.location.search || "");
if (query.grep) runner.grep(new RegExp(query.grep));
- runner.on('end', function(){
- // $('code').each(function(){
- // $(this).html(highlight($(this).text()));
- // });
- });
+ runner.on('end', highlightCode);
return runner.run();
};
})();

0 comments on commit e294b1e

Please sign in to comment.
Something went wrong with that request. Please try again.