diff --git a/app/views/catalog/_index_list_default.html.erb b/app/views/catalog/_index_list_default.html.erb index fd6bbb29b..39329f4be 100644 --- a/app/views/catalog/_index_list_default.html.erb +++ b/app/views/catalog/_index_list_default.html.erb @@ -1,39 +1,40 @@ <%# OVERRIDE Hyrax 5.0.1 to enable markdown for index field values in search results %> <%# OVERRIDE Hyrax 5.0.1 to handle search only accounts %> -
+
<% if document.collection? %> <% collection_presenter = Hyrax::CollectionPresenter.new(document, current_ability) %> -
+
- <%= collection_presenter.total_viewable_collections %>Collections + <%= collection_presenter.total_viewable_collections %>Collections
- <%= collection_presenter.total_viewable_works %>Works + <%= collection_presenter.total_viewable_works %>Works
<% end %> - diff --git a/config/features.rb b/config/features.rb index 2c01dca15..7f142d8d6 100644 --- a/config/features.rb +++ b/config/features.rb @@ -43,6 +43,6 @@ description: "Show General Login Link at Top Right of Page." feature :treat_some_user_inputs_as_markdown, - default: true, + default: false, description: "Treat some user inputs (e.g. titles and descriptions) as markdown." end diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index c3bae0751..99b36b899 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -5,9 +5,22 @@ let(:header) { '# header' } let(:bold) { '*bold*' } - it 'renders markdown into html' do - expect(helper.markdown(header)).to eq("

header

\n") - expect(helper.markdown(bold)).to eq("

bold

\n") + context 'when treat_some_user_inputs_as_markdown is true' do + it 'renders markdown into html' do + allow(Flipflop).to receive(:treat_some_user_inputs_as_markdown?).and_return(true) + + expect(helper.markdown(header)).to eq("

header

\n") + expect(helper.markdown(bold)).to eq("

bold

\n") + end + end + + context 'when treat_some_user_inputs_as_markdown is false' do + it 'does not render markdown into html' do + allow(Flipflop).to receive(:treat_some_user_inputs_as_markdown?).and_return(false) + + expect(helper.markdown(header)).to eq('# header') + expect(helper.markdown(bold)).to eq('*bold*') + end end end