69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
# File 'lib/ree_lib/packages/ree_text/package/ree_text/functions/simple_format.rb', line 69
def call(text, **opts)
options = DEFAULTS.merge(opts)
text = sanitize_html(text) if options[:sanitize]
wrapper_tag = options[:wrapper_tag]
html_options = options[:html_options]
paragraphs = split_paragraphs(text)
if is_blank(paragraphs)
content_tag_string(wrapper_tag, nil, html_options)
else
paragraphs
.map! { content_tag_string(wrapper_tag, _1, html_options) }
.join("\n\n")
end
end
|