From bad4340e15ddcdd56d6b672136260afccb185fd8 Mon Sep 17 00:00:00 2001 From: Earlopain Date: Sat, 6 Nov 2021 19:02:08 +0100 Subject: [PATCH] [DText] Prevent zalgo from overflowing Deeply nested sections still exceed the expected width. --- app/controllers/dtext_previews_controller.rb | 23 +++---------------- app/helpers/application_helper.rb | 13 +++++++++-- app/javascript/src/styles/common/dtext.scss | 6 ++++- app/javascript/src/styles/specific/blips.scss | 1 - .../src/styles/specific/comments.scss | 2 -- app/javascript/src/styles/specific/forum.scss | 1 - app/javascript/src/styles/specific/users.scss | 2 -- .../staff_notes/partials/_staff_note.html.erb | 2 +- app/views/artist_commentaries/_show.html.erb | 4 ++-- app/views/artist_commentaries/index.html.erb | 4 ++-- .../_revert_listing.html.erb | 4 ++-- .../_standard_listing.html.erb | 4 ++-- app/views/artists/_show.html.erb | 2 +- app/views/bans/index.html.erb | 2 +- app/views/bans/show.html.erb | 2 +- app/views/blips/partials/show/_blip.html.erb | 2 +- .../comments/partials/show/_comment.html.erb | 2 +- app/views/deleted_posts/index.html.erb | 2 +- app/views/dmails/show.html.erb | 2 +- app/views/dtext/_form.html.erb | 2 +- app/views/forum_posts/_forum_post.html.erb | 2 +- app/views/help/show.html.erb | 2 +- .../user/dmail_filters/edit.html.erb | 2 +- app/views/mod_actions/index.html.erb | 2 +- .../dashboards/_activity_mod_action.html.erb | 2 +- .../_activity_user_feedback.html.erb | 2 +- app/views/news_updates/_listing.html.erb | 2 +- app/views/news_updates/_listing_home.html.erb | 2 +- app/views/news_updates/index.html.erb | 2 +- app/views/pools/show.html.erb | 2 +- app/views/post_appeals/_new.html.erb | 2 +- app/views/post_events/index.html.erb | 2 +- app/views/post_flags/_new.html.erb | 6 ++--- app/views/post_flags/index.html.erb | 2 +- app/views/post_replacements/_new.html.erb | 2 +- app/views/post_sets/show.html.erb | 2 +- app/views/post_versions/_listing.html.erb | 3 +-- .../posts/partials/index/_excerpt.html.erb | 6 ++--- app/views/posts/show.html.erb | 2 +- app/views/static/terms_of_service.html.erb | 2 +- app/views/takedowns/show.html.erb | 2 +- app/views/tickets/show.html.erb | 4 ++-- app/views/user_feedbacks/index.html.erb | 2 +- app/views/user_feedbacks/show.html.erb | 2 +- app/views/user_mailer/dmail_notice.html.erb | 2 +- app/views/users/_about.html.erb | 4 ++-- app/views/users/_ban_notice.html.erb | 2 +- app/views/users/_statistics.html.erb | 2 +- app/views/wiki_page_versions/show.html.erb | 2 +- app/views/wiki_pages/show.html.erb | 2 +- app/views/wiki_pages/show_or_new.html.erb | 2 +- 51 files changed, 73 insertions(+), 84 deletions(-) diff --git a/app/controllers/dtext_previews_controller.rb b/app/controllers/dtext_previews_controller.rb index f439ed137..2f954e183 100644 --- a/app/controllers/dtext_previews_controller.rb +++ b/app/controllers/dtext_previews_controller.rb @@ -1,24 +1,7 @@ class DtextPreviewsController < ApplicationController def create - @body = params[:body] || "" - @post_ids = Set.new - @html = "" - begin - parsed = DTextRagel.parse(@body, disable_mentions: true, allow_color: CurrentUser.user.is_privileged?) - raise DTextRagel::Error.new if parsed.nil? - @post_ids.merge(parsed[1]) if parsed[1].present? - @html = parsed[0].html_safe - rescue DTextRagel::Error => e - end - render json: {html: @html, posts: deferred_posts(@post_ids)} - end - - private - - def deferred_posts(ids) - Post.includes(:uploader).where(id: ids.to_a).find_each.reduce({}) do |post_hash, p| - post_hash[p.id] = p.minimal_attributes - post_hash - end + body = params[:body] || "" + dtext = helpers.format_text(body, allow_color: CurrentUser.user.is_privileged?) + render json: { html: dtext, posts: deferred_posts } end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3dc78eebf..1fe2c08c4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -81,7 +81,7 @@ module ApplicationHelper render "application/hideable_form_search", path: path, show_on_load: show_on_load, block: block end - def format_text(text, **options) + def dtext_ragel(text, **options) options.merge!(disable_mentions: true) parsed = DTextRagel.parse(text, **options) return raw "" if parsed.nil? @@ -91,8 +91,17 @@ module ApplicationHelper raw "" end + def format_text(text, **options) + # preserve the currrent inline behaviour + if options[:inline] + dtext_ragel(text, options) + else + raw %(
#{dtext_ragel(text, options)}
) + end + end + def strip_dtext(text) - format_text(text, strip: true) + dtext_ragel(text, strip: true) end def error_messages_for(instance_name) diff --git a/app/javascript/src/styles/common/dtext.scss b/app/javascript/src/styles/common/dtext.scss index ca31ddcf2..82c2cc06c 100644 --- a/app/javascript/src/styles/common/dtext.scss +++ b/app/javascript/src/styles/common/dtext.scss @@ -1,4 +1,8 @@ - +.dtext-container { + overflow: auto; + word-wrap: anywhere; + overflow-wrap: anywhere; +} .styled-dtext { line-height: 1.4em; diff --git a/app/javascript/src/styles/specific/blips.scss b/app/javascript/src/styles/specific/blips.scss index 91004e96d..f0b5bc05d 100644 --- a/app/javascript/src/styles/specific/blips.scss +++ b/app/javascript/src/styles/specific/blips.scss @@ -3,7 +3,6 @@ div#c-blips { article.blip { margin-bottom: $base-padding; - word-wrap: break-word; &[data-is-deleted="true"] { background-color: $blip-hidden-background; diff --git a/app/javascript/src/styles/specific/comments.scss b/app/javascript/src/styles/specific/comments.scss index 413293518..3c80df24b 100644 --- a/app/javascript/src/styles/specific/comments.scss +++ b/app/javascript/src/styles/specific/comments.scss @@ -6,7 +6,6 @@ div.comments-for-post { div.list-of-comments { article.comment { border-radius: $border-radius-half; - word-wrap: break-word; margin-bottom: $padding-050; &:target { @@ -83,7 +82,6 @@ div#c-comments { padding-left: $padding-050; padding-bottom: $padding-025; margin-bottom: $padding-100; - word-wrap: break-word; .comments { margin-left: 2rem; diff --git a/app/javascript/src/styles/specific/forum.scss b/app/javascript/src/styles/specific/forum.scss index fb4332943..a74b7d620 100644 --- a/app/javascript/src/styles/specific/forum.scss +++ b/app/javascript/src/styles/specific/forum.scss @@ -3,7 +3,6 @@ div.list-of-forum-posts { article { margin: 1em 0em; - word-wrap: break-word; a.voted { font-weight: bold; diff --git a/app/javascript/src/styles/specific/users.scss b/app/javascript/src/styles/specific/users.scss index 18f3f538f..a3921a368 100644 --- a/app/javascript/src/styles/specific/users.scss +++ b/app/javascript/src/styles/specific/users.scss @@ -40,8 +40,6 @@ div#c-users { } div { flex-basis: 50%; - word-wrap: anywhere; - overflow-wrap: anywhere; } } diff --git a/app/views/admin/staff_notes/partials/_staff_note.html.erb b/app/views/admin/staff_notes/partials/_staff_note.html.erb index 82ebd7a8f..e9a0aee17 100644 --- a/app/views/admin/staff_notes/partials/_staff_note.html.erb +++ b/app/views/admin/staff_notes/partials/_staff_note.html.erb @@ -12,7 +12,7 @@ <% unless @user %>

On <%= link_to_user staff_note.user %>

<% end %> -
+
<%= format_text(staff_note.body, allow_color: true) %>
diff --git a/app/views/artist_commentaries/_show.html.erb b/app/views/artist_commentaries/_show.html.erb index fbc04af93..3c6d378bf 100644 --- a/app/views/artist_commentaries/_show.html.erb +++ b/app/views/artist_commentaries/_show.html.erb @@ -14,7 +14,7 @@ <% if artist_commentary.original_present? %> <%= tag.section id: "original-artist-commentary", style: ("display: none" if artist_commentary.translated_present?) do %>

<%= artist_commentary.original_title %>

-
+
<%= format_text(artist_commentary.original_description) %>
<% end %> @@ -29,7 +29,7 @@ <%= artist_commentary.original_title %> <% end %> -
+
<% if artist_commentary.translated_description.present? %> <%= format_text(artist_commentary.translated_description, :disable_mentions => true) %> <% else %> diff --git a/app/views/artist_commentaries/index.html.erb b/app/views/artist_commentaries/index.html.erb index 985642f03..5c1c96e33 100644 --- a/app/views/artist_commentaries/index.html.erb +++ b/app/views/artist_commentaries/index.html.erb @@ -18,13 +18,13 @@ <%= PostPresenter.preview(commentary.post, :tags => "status:any") %>

<%= h(commentary.original_title) %>

-
+
<%= format_text(commentary.original_description) %>

<%= h(commentary.translated_title) %>

-
+
<%= format_text(commentary.translated_description) %>
diff --git a/app/views/artist_commentary_versions/_revert_listing.html.erb b/app/views/artist_commentary_versions/_revert_listing.html.erb index 9e2feef11..a1ea7298f 100644 --- a/app/views/artist_commentary_versions/_revert_listing.html.erb +++ b/app/views/artist_commentary_versions/_revert_listing.html.erb @@ -21,13 +21,13 @@ <%= link_to commentary_version.post_id, post_path(commentary_version.post_id) %>

<%= h(commentary_version.original_title) %>

-
+
<%= format_text(commentary_version.original_description) %>

<%= h(commentary_version.translated_title) %>

-
+
<%= format_text(commentary_version.translated_description) %>
diff --git a/app/views/artist_commentary_versions/_standard_listing.html.erb b/app/views/artist_commentary_versions/_standard_listing.html.erb index 0cf697dc4..0dcc7b70c 100644 --- a/app/views/artist_commentary_versions/_standard_listing.html.erb +++ b/app/views/artist_commentary_versions/_standard_listing.html.erb @@ -20,13 +20,13 @@ <%= link_to "#{commentary_version.post_id}.#{commentary_version.id}ยป", artist_commentary_versions_path(search: {post_id: commentary_version.post_id}) %>

<%= h(commentary_version.original_title) %>

-
+
<%= format_text(commentary_version.original_description) %>

<%= h(commentary_version.translated_title) %>

-
+
<%= format_text(commentary_version.translated_description) %>
diff --git a/app/views/artists/_show.html.erb b/app/views/artists/_show.html.erb index 644c81073..8bb6727c3 100644 --- a/app/views/artists/_show.html.erb +++ b/app/views/artists/_show.html.erb @@ -3,7 +3,7 @@

Artist: <%= link_to @artist.pretty_name, posts_path(:tags => @artist.name), :class => "tag-type-#{@artist.category_name}" %>

<% if @artist.notes.present? && @artist.visible? %> -
+
<%= format_text(@artist.notes) %>
diff --git a/app/views/bans/index.html.erb b/app/views/bans/index.html.erb index 9d1a9ee64..12b671a1d 100644 --- a/app/views/bans/index.html.erb +++ b/app/views/bans/index.html.erb @@ -30,7 +30,7 @@ <%= time_ago_in_words_tagged(ban.created_at) %> <%= ban.humanized_duration %> <%= ban.humanized_expiration %> - <%= format_text ban.reason %> + <%= format_text ban.reason %> <% if CurrentUser.is_moderator? %> <%= link_to "Edit", edit_ban_path(ban) %> diff --git a/app/views/bans/show.html.erb b/app/views/bans/show.html.erb index 987d8f2a6..0e3a09106 100644 --- a/app/views/bans/show.html.erb +++ b/app/views/bans/show.html.erb @@ -5,7 +5,7 @@
  • User: <%= link_to_user(@ban.user) %>
  • Expires: <%= @ban.humanized_expiration %>
  • Reason: -
    <%= format_text @ban.reason %> +
    <%= format_text @ban.reason %>
  • diff --git a/app/views/blips/partials/show/_blip.html.erb b/app/views/blips/partials/show/_blip.html.erb index 6d09b94ac..1fbac07c3 100644 --- a/app/views/blips/partials/show/_blip.html.erb +++ b/app/views/blips/partials/show/_blip.html.erb @@ -20,7 +20,7 @@ <% if blip.response? %>
    <%= link_to "In response to blip ##{blip.response_to}", blip_path(id: blip.response_to) %>
    <% end %> -
    +
    <%= format_text(blip.body, allow_color: blip.creator.is_privileged?) %>
    <% if blip.was_warned? %> diff --git a/app/views/comments/partials/show/_comment.html.erb b/app/views/comments/partials/show/_comment.html.erb index 7010fc5d9..2efc7b05c 100644 --- a/app/views/comments/partials/show/_comment.html.erb +++ b/app/views/comments/partials/show/_comment.html.erb @@ -19,7 +19,7 @@
    -
    +
    <%= format_text(comment.body, allow_color: comment.creator.is_privileged?) %> <%= render "application/update_notice", record: comment %> diff --git a/app/views/deleted_posts/index.html.erb b/app/views/deleted_posts/index.html.erb index 35e0f57ca..307bc3ca4 100644 --- a/app/views/deleted_posts/index.html.erb +++ b/app/views/deleted_posts/index.html.erb @@ -16,7 +16,7 @@ <%= link_to post.id, post_path(post) %> <%= link_to_user post.uploader %> <%= post.tag_string %> - <%= format_text(post.flags.order(id: :desc).first&.reason) %> + <%= format_text(post.flags.order(id: :desc).first&.reason) %> <% end %> diff --git a/app/views/dmails/show.html.erb b/app/views/dmails/show.html.erb index 481c4101c..8292fe0b5 100644 --- a/app/views/dmails/show.html.erb +++ b/app/views/dmails/show.html.erb @@ -14,7 +14,7 @@

    Body

    -
    +
    <%= format_text(@dmail.body) %> <% if @dmail.is_automated? %> diff --git a/app/views/dtext/_form.html.erb b/app/views/dtext/_form.html.erb index 9baa53602..05c9f8a99 100644 --- a/app/views/dtext/_form.html.erb +++ b/app/views/dtext/_form.html.erb @@ -8,7 +8,7 @@ <% else %> <% end %> -
    +
    All text is formatted using <%= link_to "DText", help_page_path(id: "dtext"), :target => "_blank", tabindex: "-1" %>
    diff --git a/app/views/forum_posts/_forum_post.html.erb b/app/views/forum_posts/_forum_post.html.erb index 27d00bd62..1f086e2bc 100644 --- a/app/views/forum_posts/_forum_post.html.erb +++ b/app/views/forum_posts/_forum_post.html.erb @@ -19,7 +19,7 @@
    -
    +
    <%= format_text(parse_embedded_tag_request_text(forum_post.body), allow_color: forum_post.creator.is_privileged?) %>
    <%= render "application/update_notice", record: forum_post %> diff --git a/app/views/help/show.html.erb b/app/views/help/show.html.erb index 0b51fd515..9ae690be1 100644 --- a/app/views/help/show.html.erb +++ b/app/views/help/show.html.erb @@ -4,7 +4,7 @@

    <%= "Help: #{HelpPage.title(@help.name)}" %>

    -
    +
    <%= format_text(@wiki_page.body, allow_color: true) %>
    diff --git a/app/views/maintenance/user/dmail_filters/edit.html.erb b/app/views/maintenance/user/dmail_filters/edit.html.erb index b3ddc1234..fbb862a6a 100644 --- a/app/views/maintenance/user/dmail_filters/edit.html.erb +++ b/app/views/maintenance/user/dmail_filters/edit.html.erb @@ -15,7 +15,7 @@

    Body

    -
    +
    <%= format_text(@dmail.body) %>
    diff --git a/app/views/mod_actions/index.html.erb b/app/views/mod_actions/index.html.erb index 50bfa9289..dfe0d0882 100644 --- a/app/views/mod_actions/index.html.erb +++ b/app/views/mod_actions/index.html.erb @@ -17,7 +17,7 @@ <%= compact_time mod_action.created_at %> <%= link_to_user mod_action.creator %> - <%= format_text(mod_action.format_description) %> + <%= format_text(mod_action.format_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 dc5c549be..24ad9ce67 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.format_description) %> + <%= format_text(mod_action.format_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 b6bd607d1..78980dafc 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) %> + <%= format_text(record.body) %> <%= time_ago_in_words_tagged(record.created_at) %> <% end %> diff --git a/app/views/news_updates/_listing.html.erb b/app/views/news_updates/_listing.html.erb index 0d56890c6..2b83a661f 100644 --- a/app/views/news_updates/_listing.html.erb +++ b/app/views/news_updates/_listing.html.erb @@ -5,6 +5,6 @@ (<%= time_ago_in_words NewsUpdate.recent[0].created_at %> ago) Click to show. -
    <%= format_text(NewsUpdate.recent[0].message) %>
    +
    <%= format_text(NewsUpdate.recent[0].message) %>
    <% end %> diff --git a/app/views/news_updates/_listing_home.html.erb b/app/views/news_updates/_listing_home.html.erb index 67fdf122b..64400e5fd 100644 --- a/app/views/news_updates/_listing_home.html.erb +++ b/app/views/news_updates/_listing_home.html.erb @@ -1,3 +1,3 @@ <% if NewsUpdate.recent.present? %> -
    <%= format_text(NewsUpdate.recent[0].message) %>
    +
    <%= format_text(NewsUpdate.recent[0].message) %>
    <% end %> diff --git a/app/views/news_updates/index.html.erb b/app/views/news_updates/index.html.erb index f78c69fb6..36996ea45 100644 --- a/app/views/news_updates/index.html.erb +++ b/app/views/news_updates/index.html.erb @@ -18,7 +18,7 @@ <%= link_to_user news_update.creator %> <%= compact_time news_update.updated_at %> -
    <%= format_text news_update.message %>
    +
    <%= format_text news_update.message %>
    <% if CurrentUser.is_moderator? %> <%= link_to "Edit", edit_news_update_path(news_update) %> | <%= link_to "Delete", news_update_path(news_update), :method => :delete %> <% end %> diff --git a/app/views/pools/show.html.erb b/app/views/pools/show.html.erb index dacb00e3a..03e2eecf2 100644 --- a/app/views/pools/show.html.erb +++ b/app/views/pools/show.html.erb @@ -8,7 +8,7 @@ <% end %> -
    +
    <%= format_text(@pool.description) %>
    diff --git a/app/views/post_appeals/_new.html.erb b/app/views/post_appeals/_new.html.erb index 0a9cc6df0..6536d77ad 100644 --- a/app/views/post_appeals/_new.html.erb +++ b/app/views/post_appeals/_new.html.erb @@ -1,5 +1,5 @@
    -
    +
    <%= format_text(WikiPage.titled(Danbooru.config.appeal_notice_wiki_page).first.try(&:body)) %>
    diff --git a/app/views/post_events/index.html.erb b/app/views/post_events/index.html.erb index eb83b8614..da8499114 100644 --- a/app/views/post_events/index.html.erb +++ b/app/views/post_events/index.html.erb @@ -23,7 +23,7 @@ <% end %>
    <%= time_ago_in_words_tagged event.created_at %> - <%= format_text event.reason %> + <%= format_text event.reason %> <%= event.is_resolved %> <% end %> diff --git a/app/views/post_flags/_new.html.erb b/app/views/post_flags/_new.html.erb index a6c821452..bc9dc2e0b 100644 --- a/app/views/post_flags/_new.html.erb +++ b/app/views/post_flags/_new.html.erb @@ -5,7 +5,7 @@
    -
    +
    <%= format_text(WikiPage.titled(Danbooru.config.flag_notice_wiki_page).first.try(&:body)) %>
    @@ -23,7 +23,7 @@ <% Danbooru.config.flag_reasons.each do |flag_reason| %> <%= radio_button_tag "post_flag[reason_name]", flag_reason[:name], false %> -
    <%= format_text(flag_reason[:text]) %>
    +
    <%= format_text(flag_reason[:text]) %>
    <% if flag_reason[:parent] %> <%= f.input :parent_id, as: :integer, label: "Inferior of Post #" %> @@ -36,7 +36,7 @@ <%= radio_button_tag "post_flag[reason_name]", "user", false, disabled: !(@post.uploader_id == CurrentUser.id && @post.created_at > 48.hours.ago) %> -
    <%= format_text(Danbooru.config.flag_reason_48hours) %>
    +
    <%= format_text(Danbooru.config.flag_reason_48hours) %>
    <% if @post.uploader_id == CurrentUser.id && @post.created_at > 48.hours.ago %> <%= dtext_field "post_flag", "user_reason", name: "Reason", preview_id: "dtext-preview-for-post-flag", type: "string" %> <% end %> diff --git a/app/views/post_flags/index.html.erb b/app/views/post_flags/index.html.erb index 48b45cb9f..0ae1b1e80 100644 --- a/app/views/post_flags/index.html.erb +++ b/app/views/post_flags/index.html.erb @@ -20,7 +20,7 @@ <% @post_flags.each do |post_flag| %> <%= PostPresenter.preview(post_flag.post, :tags => "status:any") %> - + <%= format_text post_flag.reason %> diff --git a/app/views/post_replacements/_new.html.erb b/app/views/post_replacements/_new.html.erb index a846b33d3..4d2e67731 100644 --- a/app/views/post_replacements/_new.html.erb +++ b/app/views/post_replacements/_new.html.erb @@ -1,5 +1,5 @@
    -
    +
    <%= format_text(WikiPage.titled(Danbooru.config.replacement_notice_wiki_page).first.try(&:body)) %>
    diff --git a/app/views/post_sets/show.html.erb b/app/views/post_sets/show.html.erb index cf5ac4486..30dd61ff9 100644 --- a/app/views/post_sets/show.html.erb +++ b/app/views/post_sets/show.html.erb @@ -25,7 +25,7 @@ <% if @post_set.description.blank? %>
    No description.
    <% else %> -
    <%= format_text @post_set.description %>
    +
    <%= format_text @post_set.description %>
    <% end %>
    diff --git a/app/views/post_versions/_listing.html.erb b/app/views/post_versions/_listing.html.erb index 32014074f..535e795d6 100644 --- a/app/views/post_versions/_listing.html.erb +++ b/app/views/post_versions/_listing.html.erb @@ -43,7 +43,7 @@

    Description

    X
    -

    <%= format_text(post_version.description) %>

    +

    <%= format_text(post_version.description) %>

    <% end %> @@ -74,4 +74,3 @@
    <% end %>
    - diff --git a/app/views/posts/partials/index/_excerpt.html.erb b/app/views/posts/partials/index/_excerpt.html.erb index b4daa01d6..f42481cc3 100644 --- a/app/views/posts/partials/index/_excerpt.html.erb +++ b/app/views/posts/partials/index/_excerpt.html.erb @@ -5,7 +5,7 @@ <% post_set.artist.tap do |artist| %> <% if artist.visible? %> <% unless artist.notes.blank? %> -
    +
    <%= format_text(artist.notes) %>
    <% end %> @@ -23,7 +23,7 @@ <% end %> <% elsif post_set.wiki_page.present? %> <% post_set.wiki_page.tap do |wiki_page| %> -
    +
    <% if wiki_page.other_names.present? %>

    <%= wiki_page_other_names_list(wiki_page) %>

    <% end %> @@ -46,7 +46,7 @@ <% end %> -
    +
    <%= format_text(post_set.pool.description) %>
    diff --git a/app/views/posts/show.html.erb b/app/views/posts/show.html.erb index 156a80fac..a8aa0ed42 100644 --- a/app/views/posts/show.html.erb +++ b/app/views/posts/show.html.erb @@ -156,7 +156,7 @@ Description
    -
    +
    <%= format_text(@post.description, max_thumbs: 0) %>
    diff --git a/app/views/static/terms_of_service.html.erb b/app/views/static/terms_of_service.html.erb index a7147a575..8ea1d4f98 100644 --- a/app/views/static/terms_of_service.html.erb +++ b/app/views/static/terms_of_service.html.erb @@ -1,7 +1,7 @@
    -
    +
    <%= format_text(@page.body, allow_color: true) %>
    diff --git a/app/views/takedowns/show.html.erb b/app/views/takedowns/show.html.erb index 6beb43e88..db5095fe1 100644 --- a/app/views/takedowns/show.html.erb +++ b/app/views/takedowns/show.html.erb @@ -101,7 +101,7 @@ <% if !@takedown.notes.blank? && @takedown.notes.downcase != "none" %>

    Admin notes

    -
    +
    <% if !@takedown.reason_hidden || CurrentUser.is_admin? %> <%= format_text(@takedown.notes) %> <% if @takedown.reason_hidden %>(HIDDEN)<% end %> diff --git a/app/views/tickets/show.html.erb b/app/views/tickets/show.html.erb index 0c05ec5be..651556867 100644 --- a/app/views/tickets/show.html.erb +++ b/app/views/tickets/show.html.erb @@ -64,7 +64,7 @@ <% end %> <% if @ticket.can_see_reason?(CurrentUser) %> - <%= format_text(@ticket.reason) %> + <%= format_text(@ticket.reason) %> <% else %> Confidential <% end %> @@ -83,7 +83,7 @@ Response <% if @ticket.can_see_response?(CurrentUser) %> - <%= format_text(!@ticket.response.blank? ? @ticket.response : "No response.") %> + <%= format_text(!@ticket.response.blank? ? @ticket.response : "No response.") %> <% else %> Confidential <% end %> diff --git a/app/views/user_feedbacks/index.html.erb b/app/views/user_feedbacks/index.html.erb index 1509e3fb3..b44b7dbae 100644 --- a/app/views/user_feedbacks/index.html.erb +++ b/app/views/user_feedbacks/index.html.erb @@ -19,7 +19,7 @@ <%= link_to_user feedback.creator %> <%= compact_time(feedback.created_at) %> -
    +
    <%= format_text(feedback.body) %>
    <%= render "application/update_notice", record: feedback, interval: 0.minutes %> diff --git a/app/views/user_feedbacks/show.html.erb b/app/views/user_feedbacks/show.html.erb index d6a76f8d8..c9478e629 100644 --- a/app/views/user_feedbacks/show.html.erb +++ b/app/views/user_feedbacks/show.html.erb @@ -7,7 +7,7 @@
  • Date <%= @user_feedback.created_at %>
  • Category <%= @user_feedback.category %>
  • Message -
    <%= format_text @user_feedback.body %>
  • +
    <%= format_text @user_feedback.body %>
    <% if @user_feedback.editable_by?(CurrentUser.user) %> diff --git a/app/views/user_mailer/dmail_notice.html.erb b/app/views/user_mailer/dmail_notice.html.erb index 400f093eb..50e5c557e 100644 --- a/app/views/user_mailer/dmail_notice.html.erb +++ b/app/views/user_mailer/dmail_notice.html.erb @@ -3,7 +3,7 @@

    <%= @dmail.from.name %> said:

    -
    +
    <%= format_text(@dmail.body, base_url: root_url, max_thumbs: 0) %>
    diff --git a/app/views/users/_about.html.erb b/app/views/users/_about.html.erb index a060f7309..9a0de712e 100644 --- a/app/views/users/_about.html.erb +++ b/app/views/users/_about.html.erb @@ -2,13 +2,13 @@ <% if user.profile_about.present? %>

    About:

    -
    <%= format_text(user.profile_about, allow_color: true) %>
    +
    <%= format_text(user.profile_about, allow_color: true) %>
    <% end %> <% if user.profile_artinfo.present? %>

    Artist Information:

    -
    <%= format_text(user.profile_artinfo, allow_color: true) %>
    +
    <%= format_text(user.profile_artinfo, allow_color: true) %>
    <% end %>
    diff --git a/app/views/users/_ban_notice.html.erb b/app/views/users/_ban_notice.html.erb index e1a4ba84d..d10257837 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 banned

    -
    Reason: <%= format_text CurrentUser.user.recent_ban.reason %>
    +
    Reason: <%= format_text CurrentUser.user.recent_ban.reason %>

    Ban expires: <%= CurrentUser.user.recent_ban.expire_days %>

    diff --git a/app/views/users/_statistics.html.erb b/app/views/users/_statistics.html.erb index 0dc3a5492..c65a8defa 100644 --- a/app/views/users/_statistics.html.erb +++ b/app/views/users/_statistics.html.erb @@ -23,7 +23,7 @@ <% if user.is_banned? && user.recent_ban %> Ban reason - <%= format_text presenter.ban_reason %> + <%= 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 6890403b7..d0585754e 100644 --- a/app/views/wiki_page_versions/show.html.erb +++ b/app/views/wiki_page_versions/show.html.erb @@ -5,7 +5,7 @@

    <%= @wiki_page_version.pretty_title %> (<%= time_ago_in_words_tagged(@wiki_page_version.updated_at) %>)

    -
    +
    <% if @wiki_page_version.visible? %> <% if @wiki_page_version.other_names.present? %>

    <%= wiki_page_other_names_list(@wiki_page_version) %>

    diff --git a/app/views/wiki_pages/show.html.erb b/app/views/wiki_pages/show.html.erb index 47cc219fc..4446af384 100644 --- a/app/views/wiki_pages/show.html.erb +++ b/app/views/wiki_pages/show.html.erb @@ -16,7 +16,7 @@ <% end %> -
    +
    <% if @wiki_page.visible? %> <%= format_text(@wiki_page.body, allow_color: true, max_thumbs: 75) %> diff --git a/app/views/wiki_pages/show_or_new.html.erb b/app/views/wiki_pages/show_or_new.html.erb index 35f0d5267..989389a03 100644 --- a/app/views/wiki_pages/show_or_new.html.erb +++ b/app/views/wiki_pages/show_or_new.html.erb @@ -6,7 +6,7 @@

    <%= link_to @wiki_page.pretty_title_with_category, posts_path(:tags => @wiki_page.title), :class => "tag-type-#{@wiki_page.category_name}" %>

    -
    +

    This wiki page does not exist. <%= link_to "Create new wiki page", new_wiki_page_path(:wiki_page => {:title => params[:title]}) %>.