mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-10-31 23:35:00 -04:00
updated octopress.js to get new gist line number fix
This commit is contained in:
parent
1c8a4de58e
commit
76b9e3f19a
@ -40,17 +40,17 @@ function addSidebarToggler() {
|
||||
|
||||
function addCodeLineNumbers() {
|
||||
if (navigator.appName === 'Microsoft Internet Explorer') { return; }
|
||||
$('div.gist-highlight').each(function(code) {
|
||||
$('div.gist-highlight').each(function(index) {
|
||||
var tableStart = '<table><tbody><tr><td class="gutter">',
|
||||
lineNumbers = '<pre class="line-numbers">',
|
||||
tableMiddle = '</pre></td><td class="code">',
|
||||
tableEnd = '</td></tr></tbody></table>',
|
||||
count = $('.line', code).length;
|
||||
count = $('.line', this).length;
|
||||
for (var i=1;i<=count; i++) {
|
||||
lineNumbers += '<span class="line-number">'+i+'</span>\n';
|
||||
}
|
||||
var table = tableStart + lineNumbers + tableMiddle + '<pre>'+$('pre', code).html()+'</pre>' + tableEnd;
|
||||
$(code).html(table);
|
||||
var table = tableStart + lineNumbers + tableMiddle + '<pre>'+$('pre', this).html()+'</pre>' + tableEnd;
|
||||
$(this).html(table);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user