Add markdown selection support
This commit is contained in:
parent
d4e0ef254d
commit
25c3915728
15 changed files with 76 additions and 7 deletions
|
@ -11,6 +11,7 @@ class TextFormatter
|
|||
|
||||
DEFAULT_OPTIONS = {
|
||||
multiline: true,
|
||||
markdown: false,
|
||||
}.freeze
|
||||
|
||||
attr_reader :text, :options
|
||||
|
@ -44,7 +45,7 @@ class TextFormatter
|
|||
end
|
||||
|
||||
# line first letter for blockquote
|
||||
html = markdownify(html.gsub(/^>/, '>'))
|
||||
html = markdownify(html.gsub(/^>/, '>')) if markdown?
|
||||
|
||||
# html = simple_format(html, {}, sanitize: false).delete("\n") if multiline?
|
||||
html = html.delete("\n")
|
||||
|
@ -152,6 +153,10 @@ class TextFormatter
|
|||
options[:with_rel_me]
|
||||
end
|
||||
|
||||
def markdown?
|
||||
options[:markdown]
|
||||
end
|
||||
|
||||
def preloaded_accounts
|
||||
options[:preloaded_accounts]
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue