diff --git a/app/views/users/edit_profile.html.erb b/app/views/users/edit_profile.html.erb index 376665ed209f94c4b2c860a8d7f13961525e2319..25f8c6a0c34301ea1bec9c8d58d12b943e6d93ad 100644 --- a/app/views/users/edit_profile.html.erb +++ b/app/views/users/edit_profile.html.erb @@ -37,7 +37,8 @@ <%= f.text_field :username, class: 'form-element', autocomplete: 'off' %> </div> - <%= render 'shared/body_field', f: f, field_name: :profile_markdown, field_label: 'Profile', post: current_user %> + <%= render 'shared/body_field', f: f, field_name: :profile_markdown, field_label: 'Profile', post: current_user, + min_length: 0 %> <div class="post-preview"></div> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 4900e8052a1a980c33a50b8d7a42533830d202d2..925437b4249a030b3e43b001ee6d8427d567ba9b 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -44,10 +44,11 @@ <% end %> </p> - <% if @user.profile.nil? || @user.profile.blank? %> + <% effective_profile = raw(sanitize(@user.profile&.strip || '', scrubber: scrubber)) %> + <% if effective_profile.blank? %> <p class="is-lead">A quiet enigma. We don't know anything about <span dir="ltr"><%= rtl_safe_username(@user) %></span> yet.</p> <% else %> - <%= raw(sanitize(@user.profile, scrubber: scrubber)) %> + <%= effective_profile %> <% end %> </div>