FIX: Sanitize.clean raise Encoding::CompatibilityError if a page contains non ASCII-7 characters
This commit is contained in:
+14
-1
@@ -116,6 +116,19 @@ module Gollum
|
||||
@blob && @blob.data
|
||||
end
|
||||
|
||||
# Public: A text data encoded in specified encoding.
|
||||
#
|
||||
# encoding - An Encoding or nil
|
||||
#
|
||||
# Returns a character encoding aware String.
|
||||
def text_data(encoding=nil)
|
||||
if raw_data.respond_to?(:encoding)
|
||||
raw_data.force_encoding(encoding || Encoding::UTF_8)
|
||||
else
|
||||
raw_data
|
||||
end
|
||||
end
|
||||
|
||||
# Public: The formatted contents of the page.
|
||||
#
|
||||
# Returns the String data.
|
||||
@@ -344,4 +357,4 @@ module Gollum
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user