Sha256: 68c51ee241e429cdb4fdaba54ba548db0170c80c4f08d78bd68f064b6bddc57c
Contents?: true
Size: 885 Bytes
Versions: 1
Compression:
Stored size: 885 Bytes
Contents
require "active_support/concern" require "dionysus/redcarpet" module Dionysus module Redcarpet module Plaintext extend ActiveSupport::Concern included do if method_defined?(:preprocess) alias_method_chain :preprocess, :plaintext else alias_method :preprocess, :preprocess_with_plaintext end end def preprocess_with_plaintext(full_document) if full_document =~ FILE_DIRECTIVE_REGEXP if $1 == "md" and $2 == "plaintext" full_document = "```\n#{full_document.gsub(FILE_DIRECTIVE_REGEXP, "")}\n```" end end if respond_to? :preprocess_without_plaintext preprocess_without_plaintext(full_document) else full_document end end end end end Redcarpet::Render::HTML.send(:include, Dionysus::Redcarpet::Plaintext)
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
dionysus-2.1.0 | lib/dionysus/redcarpet/plaintext.rb |