Remove ruby DText implementation (#3206).

This commit is contained in:
evazion
2017-07-14 23:34:52 -05:00
parent d48ed95191
commit 7cb7c2fbab
40 changed files with 47 additions and 582 deletions

View File

@@ -49,20 +49,12 @@ module ApplicationHelper
raw %{<a href="#{h(url)}" #{attributes}>#{text}</a>}
end
def format_text(text, ragel: true, **options)
if ragel
raw DTextRagel.parse(text, **options)
else
DText.parse(text)
end
def format_text(text, **options)
raw DTextRagel.parse(text, **options)
end
def strip_dtext(text, options = {})
if options[:ragel]
raw(DTextRagel.parse_strip(text))
else
DText.parse_strip(text)
end
def strip_dtext(text)
raw(DTextRagel.parse_strip(text))
end
def error_messages_for(instance_name)

View File

@@ -4,7 +4,7 @@ module PostAppealsHelper
html << '<ul>'
post.appeals.each do |appeal|
reason = DText.parse_inline(appeal.reason).html_safe
reason = format_text(appeal.reason, inline: true)
user = link_to_user(appeal.creator)
if CurrentUser.is_moderator?
ip = "(#{link_to_ip(appeal.creator_ip_addr)})"

View File

@@ -5,7 +5,7 @@ module PostFlagsHelper
post.flags.each do |flag|
html << '<li>'
html << DText.parse_inline(flag.reason).html_safe
html << format_text(flag.reason, inline: true)
if CurrentUser.can_view_flagger?(flag.creator_id)
html << " - #{link_to_user(flag.creator)}"