site/controller.rb in stasis-0.1.1 vs site/controller.rb in stasis-0.1.2
- old
+ new
@@ -1,10 +1,11 @@
require 'albino'
require 'nokogiri'
before 'index.html.haml' do
- @readme = Nokogiri::HTML(render('../README.md')).css('body')
+ @readme = render('../README.md')
+ @readme = Nokogiri::HTML(@readme).css('body')
# Remove everything before the first <h2> tag
@readme.children.each do |node|
break if node.name == 'h2'
node.remove
@@ -23,10 +24,10 @@
end
@links.compact!
@readme.css('pre').each do |pre|
- # Retrieve language from comment
+ # Retrieve language and highlight info from comment
highlight = nil
language = nil
comment = pre.previous.previous
if comment && comment.comment?
highlight = comment.content.match(/highlight:(\S+)/)
\ No newline at end of file