lib/rabbit/parser/wiki.rb in rabbit-0.9.3 vs lib/rabbit/parser/wiki.rb in rabbit-1.0.0
- old
+ new
@@ -11,10 +11,12 @@
module Parser
class Wiki < Base
unshift_loader(self)
class << self
def match?(source)
- /^!/.match(source.read[0, 500])
+ head = source.read[0, 500]
+ head.force_encoding("ASCII-8BIT") if head.respond_to?(:force_encoding)
+ /^!/.match(head)
end
end
include Element
def parse