Class: Markdownator::Converters::PlainText
- Defined in:
- lib/markdownator/converters/plain_text.rb
Overview
Passes plain text (and Markdown) through unchanged.
Constant Summary collapse
- EXTENSIONS =
%w[txt text md markdown].freeze
- MIMETYPES =
%w[text/plain text/markdown].freeze
Instance Method Summary collapse
Instance Method Details
#accepts?(_io, stream_info) ⇒ Boolean
10 11 12 13 14 15 |
# File 'lib/markdownator/converters/plain_text.rb', line 10 def accepts?(_io, stream_info) return true if matches?(stream_info, extensions: EXTENSIONS, mimetypes: MIMETYPES) mime = stream_info.guessed_mimetype !mime.nil? && mime.start_with?("text/") end |