- <%= format_text(comment.body, :ragel => true) %>
+ <%= format_text(comment.body) %>
<% if comment.updated_at - comment.created_at > 5.minutes %>
Updated by <%= link_to_user comment.updater %> <%= time_ago_in_words_tagged(comment.updated_at) %>
diff --git a/app/views/dmails/show.html.erb b/app/views/dmails/show.html.erb
index b212666ed..0600a0b1e 100644
--- a/app/views/dmails/show.html.erb
+++ b/app/views/dmails/show.html.erb
@@ -15,7 +15,7 @@
Body
- <%= format_text(@dmail.body, :ragel => true) %>
+ <%= format_text(@dmail.body) %>
<% if @dmail.is_automated? %>
diff --git a/app/views/forum_posts/_forum_post.html.erb b/app/views/forum_posts/_forum_post.html.erb
index c6694580c..1b31895bf 100644
--- a/app/views/forum_posts/_forum_post.html.erb
+++ b/app/views/forum_posts/_forum_post.html.erb
@@ -13,7 +13,7 @@
- <%= format_text(forum_post.body, :ragel => true) %>
+ <%= format_text(forum_post.body) %>
<% if forum_post.updated_at - forum_post.created_at > 5.minutes %>
Updated by <%= link_to_user forum_post.updater %> <%= time_ago_in_words_tagged(forum_post.updated_at) %>
diff --git a/app/views/maintenance/user/dmail_filters/edit.html.erb b/app/views/maintenance/user/dmail_filters/edit.html.erb
index 2c9eb4c87..8c1e7fc51 100644
--- a/app/views/maintenance/user/dmail_filters/edit.html.erb
+++ b/app/views/maintenance/user/dmail_filters/edit.html.erb
@@ -16,7 +16,7 @@
Body
- <%= format_text(@dmail.body, :ragel => true) %>
+ <%= format_text(@dmail.body) %>
diff --git a/app/views/mod_actions/index.html.erb b/app/views/mod_actions/index.html.erb
index ea82855fd..32f30d5ef 100644
--- a/app/views/mod_actions/index.html.erb
+++ b/app/views/mod_actions/index.html.erb
@@ -14,7 +14,7 @@
| <%= compact_time mod_action.created_at %> |
<%= link_to_user mod_action.creator %> |
- <%= format_text(mod_action.description, :ragel => true) %> |
+ <%= format_text(mod_action.description) %> |
<% end %>
diff --git a/app/views/moderator/dashboards/_activity_mod_action.html.erb b/app/views/moderator/dashboards/_activity_mod_action.html.erb
index ec8a2f5f3..9c89c19e9 100644
--- a/app/views/moderator/dashboards/_activity_mod_action.html.erb
+++ b/app/views/moderator/dashboards/_activity_mod_action.html.erb
@@ -10,7 +10,7 @@
<% @dashboard.mod_actions.each do |mod_action| %>
| <%= link_to_user mod_action.creator %> |
- <%= format_text(mod_action.description, :ragel => true) %> |
+ <%= format_text(mod_action.description) %> |
<% end %>
diff --git a/app/views/moderator/dashboards/_activity_user_feedback.html.erb b/app/views/moderator/dashboards/_activity_user_feedback.html.erb
index 8f0d08250..5ac7ae6dd 100644
--- a/app/views/moderator/dashboards/_activity_user_feedback.html.erb
+++ b/app/views/moderator/dashboards/_activity_user_feedback.html.erb
@@ -11,7 +11,7 @@
<% @dashboard.user_feedbacks.each do |record| %>
| <%= link_to_user(record.user) %> |
- <%= format_text(record.body, :ragel => true) %> |
+ <%= format_text(record.body) %> |
<%= time_ago_in_words_tagged(record.created_at) %> |
<% end %>
diff --git a/app/views/pools/show.html.erb b/app/views/pools/show.html.erb
index f11f6be57..0adcf2bf4 100644
--- a/app/views/pools/show.html.erb
+++ b/app/views/pools/show.html.erb
@@ -9,7 +9,7 @@
- <%= format_text(@pool.description, :ragel => true) %>
+ <%= format_text(@pool.description) %>
<%= render "posts/partials/common/inline_blacklist" %>
diff --git a/app/views/post_appeals/_new.html.erb b/app/views/post_appeals/_new.html.erb
index 9a4118f27..181b8b5e6 100644
--- a/app/views/post_appeals/_new.html.erb
+++ b/app/views/post_appeals/_new.html.erb
@@ -1,4 +1,4 @@
-<%= format_text(WikiPage.titled(Danbooru.config.appeal_notice_wiki_page).first.try(&:body), :ragel => true) %>
+<%= format_text(WikiPage.titled(Danbooru.config.appeal_notice_wiki_page).first.try(&:body)) %>
<% @post_appeal = post_appeal %>
diff --git a/app/views/post_appeals/index.html.erb b/app/views/post_appeals/index.html.erb
index aa5e0ddbb..bd8b2bcff 100644
--- a/app/views/post_appeals/index.html.erb
+++ b/app/views/post_appeals/index.html.erb
@@ -19,7 +19,7 @@
<% @post_appeals.each do |post_appeal| %>
| <%= PostPresenter.preview(post_appeal.post, :tags => "status:any") %> |
- <%= format_text post_appeal.reason, :ragel => true %> |
+ <%= format_text post_appeal.reason %> |
<%= link_to post_appeal.post.appeals.size, post_appeals_path(search: { post_id: post_appeal.post_id }) %>
|
diff --git a/app/views/post_disapprovals/_compact_counts.html.erb b/app/views/post_disapprovals/_compact_counts.html.erb
index b32118c4b..87b5296a8 100644
--- a/app/views/post_disapprovals/_compact_counts.html.erb
+++ b/app/views/post_disapprovals/_compact_counts.html.erb
@@ -12,6 +12,6 @@
<% end %>
<% if disapprovals.map(&:message).any?(&:present?) %>
- (messages: <%= disapprovals.map(&:message).select(&:present?).map { |msg| format_text(msg, ragel: true, inline: true) }.to_sentence.html_safe %>)
+ (messages: <%= disapprovals.map(&:message).select(&:present?).map { |msg| format_text(msg, inline: true) }.to_sentence.html_safe %>)
<% end %>
<% end %>
diff --git a/app/views/post_disapprovals/_counts.html.erb b/app/views/post_disapprovals/_counts.html.erb
index 4746ec828..f7771f1c7 100644
--- a/app/views/post_disapprovals/_counts.html.erb
+++ b/app/views/post_disapprovals/_counts.html.erb
@@ -15,7 +15,7 @@
<% end %>
<% if disapprovals.map(&:message).any?(&:present?) %>
- Messages: <%= disapprovals.map(&:message).select(&:present?).map { |msg| format_text(msg, ragel: true, inline: true) }.to_sentence.html_safe %>.
+ Messages: <%= disapprovals.map(&:message).select(&:present?).map { |msg| format_text(msg, inline: true) }.to_sentence.html_safe %>.
<% end %>
<% end %>
diff --git a/app/views/post_events/index.html.erb b/app/views/post_events/index.html.erb
index 4a39215ee..c04d46fd6 100644
--- a/app/views/post_events/index.html.erb
+++ b/app/views/post_events/index.html.erb
@@ -23,7 +23,7 @@
hidden
<% end %>
- <%= format_text event.reason, :ragel => true %> |
+ <%= format_text event.reason %> |
<% if event.is_resolved %>
yes
diff --git a/app/views/post_flags/_new.html.erb b/app/views/post_flags/_new.html.erb
index 5ba550c30..25c9a1371 100644
--- a/app/views/post_flags/_new.html.erb
+++ b/app/views/post_flags/_new.html.erb
@@ -1,4 +1,4 @@
-<%= format_text(WikiPage.titled(Danbooru.config.flag_notice_wiki_page).first.try(&:body), :ragel => true) %>
+<%= format_text(WikiPage.titled(Danbooru.config.flag_notice_wiki_page).first.try(&:body)) %>
<% @post_flag = post_flag %>
diff --git a/app/views/post_flags/index.html.erb b/app/views/post_flags/index.html.erb
index 3cb77c545..81b489f1a 100644
--- a/app/views/post_flags/index.html.erb
+++ b/app/views/post_flags/index.html.erb
@@ -21,7 +21,7 @@
|
| <%= PostPresenter.preview(post_flag.post, :tags => "status:any") %> |
- <%= format_text post_flag.reason, :ragel => true %>
+ <%= format_text post_flag.reason %>
|
<%= link_to post_flag.post.flags.size, post_flags_path(search: { post_id: post_flag.post_id }) %>
diff --git a/app/views/post_replacements/_new.html.erb b/app/views/post_replacements/_new.html.erb
index e48c22023..dce3540cb 100644
--- a/app/views/post_replacements/_new.html.erb
+++ b/app/views/post_replacements/_new.html.erb
@@ -1,4 +1,4 @@
-<%= format_text(WikiPage.titled(Danbooru.config.replacement_notice_wiki_page).first.try(&:body), ragel: true) %>
+<%= format_text(WikiPage.titled(Danbooru.config.replacement_notice_wiki_page).first.try(&:body)) %>
<%= simple_form_for(post_replacement, url: post_replacements_path(post_id: post_replacement.post_id), method: :post) do |f| %>
<%= f.input :replacement_file, label: "File", as: :file %>
diff --git a/app/views/posts/partials/index/_excerpt.html.erb b/app/views/posts/partials/index/_excerpt.html.erb
index af665b21b..4223fb7ab 100644
--- a/app/views/posts/partials/index/_excerpt.html.erb
+++ b/app/views/posts/partials/index/_excerpt.html.erb
@@ -8,7 +8,7 @@
<% if artist.visible? %>
<% unless artist.notes.blank? %>
- <%= format_text(artist.notes, :ragel => true) %>
+ <%= format_text(artist.notes) %>
<% end %>
@@ -30,7 +30,7 @@
<%= wiki_page_other_names_list(wiki_page) %>
<% end %>
- <%= format_text(wiki_page.presenter.excerpt, :ragel => true) %>
+ <%= format_text(wiki_page.presenter.excerpt) %>
<%= wiki_page_alias_and_implication_list(wiki_page) %>
@@ -49,7 +49,7 @@
- <%= format_text(post_set.pool.description, :ragel => true) %>
+ <%= format_text(post_set.pool.description) %>
diff --git a/app/views/tag_aliases/show.html.erb b/app/views/tag_aliases/show.html.erb
index 884c1ea6e..91fcbba74 100644
--- a/app/views/tag_aliases/show.html.erb
+++ b/app/views/tag_aliases/show.html.erb
@@ -9,7 +9,7 @@
Creator <%= link_to_user @tag_alias.creator %>
Date <%= @tag_alias.created_at %>
<% if @tag_alias.respond_to?(:reason) && @tag_alias.reason.present? %>
- Reason <%= format_text @tag_alias.reason, :ragel => true %>
+ Reason <%= format_text @tag_alias.reason %>
<% end %>
diff --git a/app/views/tag_implications/show.html.erb b/app/views/tag_implications/show.html.erb
index 8a1f6ca02..579cd0e82 100644
--- a/app/views/tag_implications/show.html.erb
+++ b/app/views/tag_implications/show.html.erb
@@ -9,7 +9,7 @@
Creator <%= link_to_user @tag_implication.creator %>
Date <%= @tag_implication.created_at %>
<% if @tag_implication.respond_to?(:reason) && @tag_implication.reason.present? %>
- Reason <%= format_text @tag_implication.reason, :ragel => true %>
+ Reason <%= format_text @tag_implication.reason %>
<% end %>
diff --git a/app/views/uploads/new.html.erb b/app/views/uploads/new.html.erb
index a24c6ab0e..94b6421fb 100644
--- a/app/views/uploads/new.html.erb
+++ b/app/views/uploads/new.html.erb
@@ -4,7 +4,7 @@
<% if CurrentUser.can_upload? %>
- <%= format_text(@upload_notice_wiki.try(&:body), :ragel => true) %>
+ <%= format_text(@upload_notice_wiki.try(&:body)) %>
<% unless CurrentUser.can_upload_free? %>
diff --git a/app/views/user_feedbacks/index.html.erb b/app/views/user_feedbacks/index.html.erb
index 114342d6a..005e7d1bc 100644
--- a/app/views/user_feedbacks/index.html.erb
+++ b/app/views/user_feedbacks/index.html.erb
@@ -18,7 +18,7 @@
| <%= link_to_user feedback.user %> |
<%= link_to_user feedback.creator %> |
<%= compact_time(feedback.created_at) %> |
- <%= format_text(feedback.body, :ragel => true) %> |
+ <%= format_text(feedback.body) %> |
<% if feedback.editable_by?(CurrentUser.user) %>
<%= link_to "edit", edit_user_feedback_path(feedback) %>
diff --git a/app/views/user_feedbacks/show.html.erb b/app/views/user_feedbacks/show.html.erb
index 12a871af8..34efbfb57 100644
--- a/app/views/user_feedbacks/show.html.erb
+++ b/app/views/user_feedbacks/show.html.erb
@@ -6,7 +6,7 @@
Creator <%= link_to_user @user_feedback.creator %>
Date <%= @user_feedback.created_at %>
Category <%= @user_feedback.category %>
- Message <%= format_text @user_feedback.body, :ragel => true %>
+ Message <%= format_text @user_feedback.body %>
<% if @user_feedback.editable_by?(CurrentUser.user) %>
diff --git a/app/views/user_mailer/forum_notice.html.erb b/app/views/user_mailer/forum_notice.html.erb
index 7ba08cfa5..39bb1fd88 100644
--- a/app/views/user_mailer/forum_notice.html.erb
+++ b/app/views/user_mailer/forum_notice.html.erb
@@ -4,7 +4,7 @@
<%= forum_post.creator_name %> said:
- <%= format_text(forum_post.body, :ragel => true) %>
+ <%= format_text(forum_post.body) %>
diff --git a/app/views/users/_ban_notice.html.erb b/app/views/users/_ban_notice.html.erb
index 20b58df08..14194123d 100644
--- a/app/views/users/_ban_notice.html.erb
+++ b/app/views/users/_ban_notice.html.erb
@@ -1,5 +1,5 @@
Your account has been temporarily banned
- Reason: <%= format_text CurrentUser.user.recent_ban.reason, :ragel => true %>
+ Reason: <%= format_text CurrentUser.user.recent_ban.reason %>
Your ban will expire in <%= time_ago_in_words(CurrentUser.user.recent_ban.expires_at) %>
diff --git a/app/views/users/_statistics.html.erb b/app/views/users/_statistics.html.erb
index f9244056e..25d63d60c 100644
--- a/app/views/users/_statistics.html.erb
+++ b/app/views/users/_statistics.html.erb
@@ -25,7 +25,7 @@
<% if user.is_banned? && user.recent_ban %>
|
| Ban reason |
- <%= format_text presenter.ban_reason, :ragel => true %> |
+ <%= format_text presenter.ban_reason %> |
<% end %>
diff --git a/app/views/wiki_page_versions/show.html.erb b/app/views/wiki_page_versions/show.html.erb
index dcdfa1ce3..8cc04eb07 100644
--- a/app/views/wiki_page_versions/show.html.erb
+++ b/app/views/wiki_page_versions/show.html.erb
@@ -11,7 +11,7 @@
<%= wiki_page_other_names_list(@wiki_page_version) %>
<% end %>
- <%= format_text(@wiki_page_version.body, :ragel => true) %>
+ <%= format_text(@wiki_page_version.body) %>
<% else %>
The artist has requested removal of this page.
<% end %>
diff --git a/app/views/wiki_pages/show.html.erb b/app/views/wiki_pages/show.html.erb
index 6037c7d7f..c7c278abb 100644
--- a/app/views/wiki_pages/show.html.erb
+++ b/app/views/wiki_pages/show.html.erb
@@ -22,7 +22,7 @@
<%= wiki_page_other_names_list(@wiki_page) %>
<% end %>
- <%= format_text(@wiki_page.body, :ragel => true) %>
+ <%= format_text(@wiki_page.body) %>
<% if @wiki_page.artist %>
<%= link_to "View artist", @wiki_page.artist %>
diff --git a/test/unit/dtext_test.rb b/test/unit/dtext_test.rb
deleted file mode 100644
index 735954a72..000000000
--- a/test/unit/dtext_test.rb
+++ /dev/null
@@ -1,196 +0,0 @@
-require "test_helper"
-
-class DTextTest < ActiveSupport::TestCase
- def p(s)
- DText.parse(s)
- end
-
- def test_mentions
- assert_equal('
@bob
', p("@bob"))
- assert_equal('
hi @bob
', p("hi @bob"))
- assert_equal('
this is not @.@ @_@ @bob
', p("this is not @.@ @_@ @bob"))
- assert_equal('
multiple @bob @anna
', p("multiple @bob @anna"))
- end
-
- def test_sanitize_heart
- assert_equal('
<3
', p("<3"))
- end
-
- def test_sanitize_less_than
- assert_equal('
<
', p("<"))
- end
-
- def test_sanitize_greater_than
- assert_equal('
>
', p(">"))
- end
-
- def test_sanitize_ampersand
- assert_equal('
&
', p("&"))
- end
-
- def test_wiki_links
- assert_equal("
a b c
", p("a [[b]] c"))
- end
-
- def test_wiki_links_spoiler
- assert_equal("
a spoiler c
", p("a [[spoiler]] c"))
- end
-
- def test_spoilers_inline
- assert_equal("
this is
.
", p("this is [spoiler]an inline spoiler[/spoiler]."))
- end
-
- def test_spoilers_block
- assert_equal("
this is
.
", p("this is\n\n[spoiler]\na block spoiler\n[/spoiler]."))
- end
-
- def test_spoilers_with_no_closing_tag_1
- assert_equal("
this is a spoiler with no closing tag
new text
", p("[spoiler]this is a spoiler with no closing tag\n\nnew text"))
- end
-
- def test_spoilers_with_no_closing_tag_2
- assert_equal("
this is a spoiler with no closing tag
new text
", p("[spoiler]this is a spoiler with no closing tag\nnew text"))
- end
-
- def test_spoilers_with_no_closing_tag_block
- assert_equal("
this is a block spoiler with no closing tag
", p("[spoiler]\nthis is a block spoiler with no closing tag"))
- end
-
- def test_spoilers_nested
- assert_equal("
", p("[spoiler]this is [spoiler]a nested[/spoiler] spoiler[/spoiler]"))
- end
-
- def test_paragraphs
- assert_equal("
abc
", p("abc"))
- end
-
- def test_paragraphs_with_newlines_1
- assert_equal("
a
b
c
", p("a\nb\nc"))
- end
-
- def test_paragraphs_with_newlines_2
- assert_equal("
a
b
", p("a\n\nb"))
- end
-
- def test_headers
- assert_equal("
header
", p("h1. header"))
- end
-
- def test_headers_with_ids
- assert_equal("", p("h1#header-id. header"))
- end
-
- def test_quote_blocks
- assert_equal('
test
', p("[quote]\ntest\n[/quote]"))
- end
-
- def test_quote_blocks_nested
- assert_equal("
a
b
c
", p("[quote]\na\n[quote]\nb\n[/quote]\nc\n[/quote]"))
- end
-
- def test_code
- assert_equal("
for (i=0; i<5; ++i) {\n printf(1);\n}\n\nexit(1);\n\n", p("[code]for (i=0; i<5; ++i) {\n printf(1);\n}\n\nexit(1);"))
- end
-
- def test_urls
- assert_equal('
a http://test.com b
', p('a http://test.com b'))
- end
-
- def test_urls_with_newline
- assert_equal('
http://test.com
b
', p("http://test.com\nb"))
- end
-
- def test_urls_with_paths
- assert_equal('
a http://test.com/~bob/image.jpg b
', p('a http://test.com/~bob/image.jpg b'))
- end
-
- def test_urls_with_fragment
- assert_equal('
a http://test.com/home.html#toc b
', p('a http://test.com/home.html#toc b'))
- end
-
- def test_auto_urls
- assert_equal('
a http://test.com. b
', p('a http://test.com. b'))
- end
-
- def test_auto_urls_in_parentheses
- assert_equal('
a (http://test.com) b
', p('a (http://test.com) b'))
- end
-
- def test_old_style_links
- assert_equal('
test
', p('"test":http://test.com'))
- end
-
- def test_old_style_links_with_special_entities
- assert_equal('
"1" 2 & 3
', p('"1" "2 & 3":http://three.com'))
- end
-
- def test_new_style_links
- assert_equal('
test
', p('"test":[http://test.com]'))
- end
-
- def test_new_style_links_with_parentheses
- assert_equal('
test
', p('"test":[http://test.com/(parentheses)]'))
- assert_equal('
(test)
', p('("test":[http://test.com/(parentheses)])'))
- assert_equal('
[test]
', p('["test":[http://test.com/(parentheses)]]'))
- end
-
- def test_lists_1
- assert_equal('
', p('* a'))
- end
-
- def test_lists_2
- assert_equal('
', p("* a\n* b").gsub(/\n/, ""))
- end
-
- def test_lists_nested
- assert_equal('
', p("* a\n** b").gsub(/\n/, ""))
- end
-
- def test_lists_inline
- assert_equal('
', p("* post #1").gsub(/\n/, ""))
- end
-
- def test_lists_not_preceded_by_newline
- assert_equal('
ab
', p("a\nb\n* c\n* d").gsub(/\n/, ""))
- end
-
- def test_lists_with_multiline_items
- assert_equal('
a
', p("a\n* b\nc\n* d\ne").gsub(/\n/, ""))
- end
-
- def test_inline_tags
- assert_equal('
tag
', p("{{tag}}"))
- end
-
- def test_inline_tags_conjunction
- assert_equal('
tag1 tag2
', p("{{tag1 tag2}}"))
- end
-
- def test_inline_tags_special_entities
- assert_equal('
<3
', p("{{<3}}"))
- end
-
- def test_extra_newlines
- assert_equal('
a
b
', p("a\n\n\n\n\n\n\nb\n\n\n\n"))
- end
-
- def test_complex_links_1
- assert_equal("
2 3 | 5 6
", p("[[1|2 3]] | [[4|5 6]]"))
- end
-
- def test_complex_links_2
- assert_equal("
Tags (Tagging Guidelines | Tag Checklist | Tag Groups)
", p("Tags [b]([[howto:tag|Tagging Guidelines]] | [[howto:tag_checklist|Tag Checklist]] | [[Tag Groups]])[/b]"))
- end
-
- def test_table
- assert_equal("
", p("[table][thead][tr][th]header[/th][/tr][/thead][tbody][tr][td]post #100[/td][/tr][/tbody][/table]"))
- end
-
- def test_table_with_newlines
- assert_equal("
", p("[table]\n[thead]\n[tr]\n[th]header[/th][/tr][/thead][tbody][tr][td]post #100[/td][/tr][/tbody][/table]"))
- end
-
- def test_forum_links
- assert_equal('
topic #1234/p4
', p("topic #1234/p4"))
- end
-end