Sha256: c8a63b934fdf567e3d453de55e057df1dc04ff70081be082e7583092a1bf97e3
Contents?: true
Size: 487 Bytes
Versions: 39
Compression:
Stored size: 487 Bytes
Contents
# encoding: utf-8 class MarkdownString # Return markdown backquotes from text # # === Example # # MarkdownString.backquotes "hoge\nhige\nhage\n" # # result # # >hoge # >hige # >hage # def self.backquotes(text) return '>' if text.nil? return text unless text.is_a?(String) return '>' if text.empty? text.split("\n").reduce([]) do |ret, elm| ret << ">#{elm} " ret end.join("\n") + "\n" end end
Version data entries
39 entries across 39 versions & 1 rubygems