diff --git a/app/views/shared/export/_plan.erb b/app/views/shared/export/_plan.erb index ca21594..467665f 100644 --- a/app/views/shared/export/_plan.erb +++ b/app/views/shared/export/_plan.erb @@ -40,7 +40,7 @@ <% end %> <% answer = @plan.answer(question[:id], false) %> - <% blank = answer.present? ? answer.text.gsub(/<\/?p>/, '').gsub(//, '').chomp.blank? : true %> + <% blank = (answer.present? && answer.is_valid?) ? answer.text.gsub(/<\/?p>/, '').gsub(//, '').chomp.blank? : true %> <% if blank && @show_unanswered %>

<%= _('Question not answered.') -%>

<% elsif !blank %> diff --git a/app/views/shared/export/_plan_txt.erb b/app/views/shared/export/_plan_txt.erb index edcfc19..6c1ee28 100644 --- a/app/views/shared/export/_plan_txt.erb +++ b/app/views/shared/export/_plan_txt.erb @@ -39,7 +39,7 @@ <% end %> <% end %> <% answer = @plan.answer(question[:id], false) %> - <% blank = answer.present? ? answer.text.gsub(/<\/?p>/, '').gsub(//, '').chomp.blank? : true %> + <% blank = (answer.present? && answer.is_valid?) ? answer.text.gsub(/<\/?p>/, '').gsub(//, '').chomp.blank? : true %> <% if blank && @show_unanswered %> <%= " #{_("Question not answered.")}\n\n" %> <% elsif !blank %>