added support for pygments.rb removing dependency on pygments, added support for caching highlighted code from pygments.rb and added default line numbering. Javascript auto line numbering now only occurs for embedded gists
This commit is contained in:
parent
727a149227
commit
7b81aab5ac
8 changed files with 55 additions and 48 deletions
|
@ -48,8 +48,7 @@ function testFeatures() {
|
|||
|
||||
function addCodeLineNumbers(){
|
||||
if (navigator.appName == 'Microsoft Internet Explorer') { return }
|
||||
$('div.highlight pre code').each(function(el){ addDivLines(el); });
|
||||
$('div.highlight, div.gist-highlight').each(function(code){
|
||||
$('div.gist-highlight').each(function(code){
|
||||
var tableStart = '<table cellpadding="0" cellspacing="0"><tbody><tr><td class="gutter">';
|
||||
var lineNumbers = '<pre class="line-numbers">';
|
||||
var tableMiddle = '</pre></td><td class="code" width="100%">';
|
||||
|
@ -62,16 +61,6 @@ function addCodeLineNumbers(){
|
|||
$(code).html(table);
|
||||
});
|
||||
}
|
||||
function addDivLines(el){
|
||||
var content = $(el).html();
|
||||
var lines = content.replace(/\s*$/g, '').split(/\n/);
|
||||
var count = lines.length;
|
||||
$(lines).each(function(line, index){
|
||||
if(line == '') line = ' ';
|
||||
lines[index] = '<div class="line">' + line + '</div>';
|
||||
});
|
||||
$(el).html(lines.join(''));
|
||||
}
|
||||
|
||||
function flashVideoFallback(){
|
||||
var flashplayerlocation = "/assets/jwplayer/player.swf",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue