Fix quote inline not hidden on WebUI
This commit is contained in:
parent
32be19d6f1
commit
bc36f0fa9b
@ -31,7 +31,7 @@ class TextFormatter
|
||||
end
|
||||
|
||||
def to_s
|
||||
return ''.html_safe if text.blank?
|
||||
return ''.html_safe if text.blank? & !quote?
|
||||
|
||||
html = rewrite do |entity|
|
||||
if entity[:url]
|
||||
@ -43,6 +43,8 @@ class TextFormatter
|
||||
end
|
||||
end
|
||||
|
||||
html += render_quote if quote?
|
||||
|
||||
html = simple_format(html, {}, sanitize: false).delete("\n") if multiline?
|
||||
|
||||
html.html_safe # rubocop:disable Rails/OutputSafety
|
||||
@ -126,6 +128,13 @@ class TextFormatter
|
||||
HTML
|
||||
end
|
||||
|
||||
def render_quote
|
||||
link = link_to_url({ url: ap_tag_manager.url_for(quote) })
|
||||
<<~HTML.squish
|
||||
<span class="quote-inline"><br/>~~~~~~~~~~<br/>[#{link}]</span>
|
||||
HTML
|
||||
end
|
||||
|
||||
def entity_cache
|
||||
@entity_cache ||= EntityCache.instance
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user