Sha256: e0235815441bcadb8763d04ba532f5ac761c519dff5077242f396d4b19d2aed2
Contents?: true
Size: 521 Bytes
Versions: 6
Compression:
Stored size: 521 Bytes
Contents
module Govspeak module BlockquoteExtraQuoteRemover QUOTE = '"\u201C\u201D\u201E\u201F\u2033\u2036'.freeze LINE_BREAK = '\r\n?|\n'.freeze # 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
6 entries across 6 versions & 1 rubygems