aboutsummaryrefslogtreecommitdiff
path: root/plugins/pygments_code.rb
diff options
context:
space:
mode:
authorBrandon Mathis <brandon@imathis.com>2011-07-30 09:06:38 -0400
committerBrandon Mathis <brandon@imathis.com>2011-07-30 09:06:56 -0400
commitcb6442e6249099ce708c0d26af84738eaef240a2 (patch)
tree43a486b15c69fe76b9f3ab8ec1f11af16fd6d3b8 /plugins/pygments_code.rb
parentc837acd497dd1b58ab6c12cf726fda228ac1418e (diff)
downloadmy_new_personal_website-cb6442e6249099ce708c0d26af84738eaef240a2.tar.xz
my_new_personal_website-cb6442e6249099ce708c0d26af84738eaef240a2.zip
fixed empty line stripping from codeblocks
Diffstat (limited to 'plugins/pygments_code.rb')
-rw-r--r--plugins/pygments_code.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/pygments_code.rb b/plugins/pygments_code.rb
index 05b4fb57..cdd6c3a4 100644
--- a/plugins/pygments_code.rb
+++ b/plugins/pygments_code.rb
@@ -7,7 +7,7 @@ FileUtils.mkdir_p(PYGMENTS_CACHE_DIR)
module HighlightCode
def highlight(str, lang)
- str = pygments(str, lang).match(/<pre>(.+)<\/pre>/m)[1].to_s.gsub(/\s*$/, '') #strip out divs <div class="highlight">
+ str = pygments(str, lang).match(/<pre>(.+)<\/pre>/m)[1].to_s.gsub(/ *$/, '') #strip out divs <div class="highlight">
table = '<div class="highlight"><table cellpadding="0" cellspacing="0"><tr><td class="gutter"><pre class="line-numbers">'
code = ''
str.lines.each_with_index do |line,index|