Merge pull request #6827 from betagouv/6788-a11y-demande
fix a11y-8.9.1
This commit is contained in:
commit
c63a8c83e9
4 changed files with 4 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
module StringToHtmlHelper
|
module StringToHtmlHelper
|
||||||
def string_to_html(str, wrapper_tag = 'p')
|
def string_to_html(str, wrapper_tag = 'p')
|
||||||
|
return nil if str.blank?
|
||||||
html_formatted = simple_format(str, {}, { wrapper_tag: wrapper_tag })
|
html_formatted = simple_format(str, {}, { wrapper_tag: wrapper_tag })
|
||||||
with_links = Anchored::Linker.auto_link(html_formatted, target: '_blank', rel: 'noopener')
|
with_links = Anchored::Linker.auto_link(html_formatted, target: '_blank', rel: 'noopener')
|
||||||
sanitize(with_links, attributes: ['target', 'rel', 'href'])
|
sanitize(with_links, attributes: ['target', 'rel', 'href'])
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
%p.attachment-error-title
|
%p.attachment-error-title
|
||||||
Une erreur s’est produite pendant l’envoi du fichier.
|
Une erreur s’est produite pendant l’envoi du fichier.
|
||||||
%p.attachment-error-description
|
%p.attachment-error-description
|
||||||
|
Une erreur inconnue s'est produite pendant l'envoi du fichier
|
||||||
= button_tag type: 'button', class: 'button attachment-error-retry', data: { 'input-target': ".attachment-input-#{attachment_id}" } do
|
= button_tag type: 'button', class: 'button attachment-error-retry', data: { 'input-target': ".attachment-input-#{attachment_id}" } do
|
||||||
%span.icon.retry
|
%span.icon.retry
|
||||||
Ré-essayer
|
Ré-essayer
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
- when TypeDeChamp.type_champs.fetch(:number)
|
- when TypeDeChamp.type_champs.fetch(:number)
|
||||||
= number_with_html_delimiter(c.to_s)
|
= number_with_html_delimiter(c.to_s)
|
||||||
- else
|
- else
|
||||||
= format_text_value(c.to_s)
|
= format_text_value(c.to_s) unless c.blank?
|
||||||
|
|
||||||
- if c.type_champ != TypeDeChamp.type_champs.fetch(:header_section)
|
- if c.type_champ != TypeDeChamp.type_champs.fetch(:header_section)
|
||||||
%td.updated-at
|
%td.updated-at
|
||||||
|
|
|
@ -28,7 +28,7 @@ RSpec.describe StringToHtmlHelper, type: :helper do
|
||||||
context "with empty decription" do
|
context "with empty decription" do
|
||||||
let(:description) { nil }
|
let(:description) { nil }
|
||||||
|
|
||||||
it { is_expected.to eq('<p></p>') }
|
it { is_expected.to eq nil }
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with a bad script" do
|
context "with a bad script" do
|
||||||
|
|
Loading…
Add table
Reference in a new issue