lib/yard/templates/helpers/html_helper.rb in yard-0.8.2.1 vs lib/yard/templates/helpers/html_helper.rb in yard-0.8.3
- old
+ new
@@ -58,11 +58,12 @@
# TODO: other libraries might be more complex
provider = markup_class(:markdown)
if provider.to_s == 'RDiscount'
provider.new(text, :autolink).to_html
elsif provider.to_s == 'RedcarpetCompat'
- provider.new(text, :gh_blockcode, :fenced_code, :autolink).to_html
+ provider.new(text, :no_intraemphasis, :gh_blockcode,
+ :fenced_code, :autolink).to_html
else
provider.new(text).to_html
end
end
@@ -506,14 +507,15 @@
# +Encoding.default_external+.
#
# @return [String] the current character set
# @since 0.5.4
def charset
- if @file && RUBY19
+ has_encoding = defined?(::Encoding)
+ if @file && has_encoding
lang = @file.contents.encoding.to_s
else
- return 'utf-8' unless RUBY19 || lang = ENV['LANG']
- if RUBY19
+ return 'utf-8' unless has_encoding || lang = ENV['LANG']
+ if has_encoding
lang = ::Encoding.default_external.name.downcase
else
lang = lang.downcase.split('.').last
end
end