Sha256: 4f22a1ebf69baca9e6efaaa0ec1a44399797f35d50bc984025d650447a7b0ae1

Contents?: true

Size: 506 Bytes

Versions: 13

Compression:

Stored size: 506 Bytes

Contents

module Govspeak
  module BlockquoteExtraQuoteRemover
    QUOTE = '"\u201C\u201D\u201E\u201F\u2033\u2036'
    LINE_BREAK = '\r\n?|\n'

    # used to remove quotes from a markdown blockquote, as these will be inserted
    # as part of the rendering
    #
    # for example:
    # > "test"
    #
    # will be formatted to:
    # > test
    def self.remove(source)
      return if source.nil?
      source.gsub(/^>[ \t]*[#{QUOTE}]*([^ \t\n].+?)[#{QUOTE}]*[ \t]*(#{LINE_BREAK}?)$/, '> \1\2')
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
govspeak-5.6.0 lib/govspeak/blockquote_extra_quote_remover.rb
govspeak-5.5.0 lib/govspeak/blockquote_extra_quote_remover.rb
govspeak-5.4.0 lib/govspeak/blockquote_extra_quote_remover.rb
govspeak-5.3.0 lib/govspeak/blockquote_extra_quote_remover.rb
govspeak-5.2.2 lib/govspeak/blockquote_extra_quote_remover.rb
govspeak-5.2.1 lib/govspeak/blockquote_extra_quote_remover.rb
govspeak-5.2.0 lib/govspeak/blockquote_extra_quote_remover.rb
govspeak-5.1.0 lib/govspeak/blockquote_extra_quote_remover.rb
govspeak-5.0.3 lib/govspeak/blockquote_extra_quote_remover.rb
govspeak-5.0.2 lib/govspeak/blockquote_extra_quote_remover.rb
govspeak-5.0.1 lib/govspeak/blockquote_extra_quote_remover.rb
govspeak-5.0.0 lib/govspeak/blockquote_extra_quote_remover.rb
govspeak-4.0.0 lib/govspeak/blockquote_extra_quote_remover.rb