Module: Govspeak::BlockquoteExtraQuoteRemover

Defined in:
lib/govspeak/blockquote_extra_quote_remover.rb

Constant Summary collapse

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

Class Method Summary collapse

Class Method Details

.remove(source) ⇒ Object

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



14
15
16
17
# File 'lib/govspeak/blockquote_extra_quote_remover.rb', line 14

def self.remove(source)
  return if source.nil?
  source.gsub(/^>[ \t]*[#{QUOTE}]*([^ \t\n].+?)[#{QUOTE}]*[ \t]*(#{LINE_BREAK}?)$/, '> \1\2')
end