Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Whitespace cleanup

  • Loading branch information...
commit 385b7aa2b5b748a6905b6739f815333d00f828f7 1 parent 73f54a8
@namelessjon namelessjon authored committed
Showing with 11 additions and 11 deletions.
  1. +11 −11 lib/glorify.rb
View
22 lib/glorify.rb
@@ -10,10 +10,10 @@ module Glorify
module Helpers
def glorify text
options = [:filter_html, :autolink,
- :no_intraemphasis, :fenced_code, :gh_blockcode]
+ :no_intraemphasis, :fenced_code, :gh_blockcode]
highlighter(Redcarpet.new(text, *options).to_html)
- end
-
+ end
+
def glorify_css
<<-css
.hll { background-color: #ffffcc }
@@ -81,22 +81,22 @@ def glorify_css
private
def highlighter html
- doc = Nokogiri::HTML(html)
- doc.search("//pre[@lang]").each do |pre|
+ doc = Nokogiri::HTML(html)
+ doc.search("//pre[@lang]").each do |pre|
pre.replace colorize(pre.text.rstrip, pre[:lang])
- end
+ end
doc.search('pre').each do |pre|
pre.children.each do |c|
c.parent = pre.parent
end
- pre.remove
- end
+ pre.remove
+ end
doc.search('div').each do |div|
if div['class'] == 'highlight'
div.replace(Nokogiri.make("<pre>#{div.to_html}</pre>"))
end
- end
- doc.to_s
+ end
+ doc.to_s
end
def colorize(code, lang)
@@ -112,7 +112,7 @@ def pygmentize?
system 'pygmentize -V'
end
end
-
+
def self.registered(app)
app.helpers Glorify::Helpers
app.get '/pygments.css' do
Please sign in to comment.
Something went wrong with that request. Please try again.