...
|
...
|
@@ -7,7 +7,7 @@ FileUtils.mkdir_p(PYGMENTS_CACHE_DIR)
|
7
|
7
|
|
8
|
8
|
module HighlightCode
|
9
|
9
|
def highlight(str, lang)
|
10
|
|
- str = pygments(str, lang).match(/<pre>(.+)<\/pre>/m)[1].to_s.gsub(/\s*$/, '') #strip out divs <div class="highlight">
|
|
10
|
+ str = pygments(str, lang).match(/<pre>(.+)<\/pre>/m)[1].to_s.gsub(/ *$/, '') #strip out divs <div class="highlight">
|
11
|
11
|
table = '<div class="highlight"><table cellpadding="0" cellspacing="0"><tr><td class="gutter"><pre class="line-numbers">'
|
12
|
12
|
code = ''
|
13
|
13
|
str.lines.each_with_index do |line,index|
|