Permalink
Browse files

work with tilt minimal-encodings branch

  • Loading branch information...
zzak committed Mar 19, 2013
1 parent 8e90bd1 commit cab05d0600f06b485ee9e9540c4faf3e03fa9c3d
Showing with 7 additions and 0 deletions.
  1. +2 −0 Gemfile
  2. +5 −0 lib/glorify/template.rb
View
@@ -1,3 +1,5 @@
source "http://rubygems.org"
+gem "tilt", :git => "git://github.com/rtomayko/tilt.git", :branch => "minimal-encodings"
+
gemspec
View
@@ -21,6 +21,10 @@ module Glorify
# markdown :a_view_with_code_blocks
# end
class Template < Tilt::Template
+ def default_encoding
+ 'UTF-8'
+ end
+
def prepare # :nodoc:
@engine = Redcarpet::Markdown.new(Glorify::Renderer.new,
Glorify::EXTENSIONS)
@@ -29,6 +33,7 @@ def prepare # :nodoc:
def evaluate(scope, locals, &block) # :nodoc:
@output ||= @engine.render(data)
+ @output.force_encoding('UTF-8')
end
end
end

0 comments on commit cab05d0

Please sign in to comment.