diff --git a/.themes/classic/source/javascripts/octopress.js b/.themes/classic/source/javascripts/octopress.js index 08928e7..5c95d91 100644 --- a/.themes/classic/source/javascripts/octopress.js +++ b/.themes/classic/source/javascripts/octopress.js @@ -38,6 +38,7 @@ var octopress = (function(){ } if (sections.length >= 3){ $('aside.sidebar').addClass('thirds'); } } + , addCodeLineNumbers: function () { if (navigator.appName === 'Microsoft Internet Explorer') { return; } $('div.gist-highlight').each(function(index) { @@ -208,11 +209,21 @@ var octopress = (function(){ })() , github: (function(){ + + htmlEscape = function (str) { + return String(str) + .replace(/&/g, '&') + .replace(/"/g, '"') + .replace(/'/g, ''') + .replace(//g, '>'); + } + function render(target, data){ var i = 0, repos = ''; for(i = 0; i < data.length; i++) { - repos += '
'+data[i].description+'
'+htmlEscape(data[i].description)+'