lib/review/htmlutils.rb in review-1.7.2 vs lib/review/htmlutils.rb in review-2.0.0.beta1
- old
+ new
@@ -38,11 +38,11 @@
def escape_comment(str)
str.gsub('-', '-')
end
- def highlight?
+ def highlight_pygments?
@book.config["pygments"].present? ||
@book.config["highlight"] && @book.config["highlight"]["html"] == "pygments"
end
def highlight(ops)
@@ -56,11 +56,11 @@
format = ops[:format] || ''
options = {:nowrap => true, :noclasses => true}
if ops[:options] && ops[:options].kind_of?(Hash)
options.merge!(ops[:options])
end
- return body if !highlight?
+ return body if !highlight_pygments?
begin
require 'pygments'
begin
Pygments.highlight(
@@ -70,11 +70,11 @@
:lexer => lexer)
rescue MentosError
body
end
rescue LoadError
- body
+ body
end
end
def normalize_id(id)
if id =~ /\A[a-z][a-z0-9_.-]*\Z/i
@@ -85,6 +85,6 @@
return "id_#{CGI.escape(id.gsub("_", "__")).gsub("%", "_").gsub("+", "-")}" # escape all
end
end
end
-end # module ReVIEW
+end # module ReVIEW