Sha256: e7538d4a46b4f65f37f8488c4bed83828f96005cea8b2c217f48fdcef916ae22
Contents?: true
Size: 452 Bytes
Versions: 39
Compression:
Stored size: 452 Bytes
Contents
# encoding: utf-8 class MarkdownString # Return markdown link from label and url # # === Example # # case list # # MarkdownString.link 'label', 'http://hogehogehoge.com' # # result # # '[label](http://hogehogehoge.com)' # def self.link(label, url) label = '' if label.nil? url = '' if url.nil? return label unless label.is_a?(String) return url unless url.is_a?(String) "[#{label}](#{url})" end end
Version data entries
39 entries across 39 versions & 1 rubygems