lib/review/htmlutils.rb in review-1.5.0 vs lib/review/htmlutils.rb in review-1.6.0
- old
+ new
@@ -45,10 +45,15 @@
@book.config["highlight"] && @book.config["highlight"]["html"] == "pygments"
end
def highlight(ops)
body = ops[:body] || ''
- lexer = ops[:lexer].blank? ? 'text' : ops[:lexer]
+ if @book.config["highlight"] && @book.config["highlight"]["lang"]
+ lexer = @book.config["highlight"]["lang"] # default setting
+ else
+ lexer = 'text'
+ end
+ lexer = ops[:lexer] if ops[:lexer].present?
format = ops[:format] || ''
options = {:nowrap => true, :noclasses => true}
if ops[:options] && ops[:options].kind_of?(Hash)
options.merge!(ops[:options])
end